From 749e778c06a881daa270f97a28eff92f4dd691a6 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 09:12:24 +0200 Subject: [PATCH 1/7] Renames of component schema types, fix deviating property order between net60/net80 --- .../JsonApiDotNetCoreExample.json | 984 ++++++------- .../People/Item/PeopleItemRequestBuilder.cs | 8 +- .../Api/People/PeopleRequestBuilder.cs | 8 +- .../Api/Tags/Item/TagsItemRequestBuilder.cs | 8 +- .../Api/Tags/TagsRequestBuilder.cs | 8 +- .../Item/TodoItemsItemRequestBuilder.cs | 8 +- .../Api/TodoItems/TodoItemsRequestBuilder.cs | 8 +- ....cs => AttributesInCreatePersonRequest.cs} | 12 +- ...est.cs => AttributesInCreateTagRequest.cs} | 12 +- ...s => AttributesInCreateTodoItemRequest.cs} | 12 +- ....cs => AttributesInUpdatePersonRequest.cs} | 12 +- ...est.cs => AttributesInUpdateTagRequest.cs} | 12 +- ...s => AttributesInUpdateTodoItemRequest.cs} | 12 +- ...ment.cs => CreatePersonRequestDocument.cs} | 24 +- .../Models/CreateTagRequestDocument.cs | 26 +- ...nt.cs => CreateTodoItemRequestDocument.cs} | 24 +- ...equest.cs => DataInCreatePersonRequest.cs} | 36 +- ...stRequest.cs => DataInCreateTagRequest.cs} | 36 +- ...uest.cs => DataInCreateTodoItemRequest.cs} | 36 +- ...equest.cs => DataInUpdatePersonRequest.cs} | 36 +- ...chRequest.cs => DataInUpdateTagRequest.cs} | 36 +- ...uest.cs => DataInUpdateTodoItemRequest.cs} | 36 +- ... => RelationshipsInCreatePersonRequest.cs} | 12 +- ....cs => RelationshipsInCreateTagRequest.cs} | 12 +- ...> RelationshipsInCreateTodoItemRequest.cs} | 12 +- ... => RelationshipsInUpdatePersonRequest.cs} | 12 +- ....cs => RelationshipsInUpdateTagRequest.cs} | 12 +- ...> RelationshipsInUpdateTodoItemRequest.cs} | 12 +- .../Models/TagPostRequestDocument.cs | 67 - .../Models/UpdatePersonRequestDocument.cs | 26 +- ...ocument.cs => UpdateTagRequestDocument.cs} | 24 +- .../Models/UpdateTodoItemRequestDocument.cs | 67 + .../OpenApiKiotaClientExample/Worker.cs | 6 +- .../OpenApiNSwagClientExample/Worker.cs | 8 +- ...onApiActionDescriptorCollectionProvider.cs | 2 +- .../JsonApiEndpoint.cs | 8 +- .../JsonApiMetadata/EndpointResolver.cs | 6 +- .../JsonApiEndpointMetadataProvider.cs | 16 +- ...nt.cs => CreateResourceRequestDocument.cs} | 4 +- ...nt.cs => UpdateResourceRequestDocument.cs} | 4 +- .../JsonApiObjects/JsonApiSchemaFacts.cs | 4 +- ...s => AttributesInCreateResourceRequest.cs} | 2 +- ...s => AttributesInUpdateResourceRequest.cs} | 2 +- ...uest.cs => DataInCreateResourceRequest.cs} | 6 +- ...uest.cs => DataInUpdateResourceRequest.cs} | 6 +- ...> RelationshipsInCreateResourceRequest.cs} | 2 +- ...> RelationshipsInUpdateResourceRequest.cs} | 2 +- .../JsonApiOperationIdSelector.cs | 8 +- .../JsonApiRoutingTemplate.cs | 6 +- .../JsonApiSchemaIdSelector.cs | 16 +- .../OpenApiEndpointConvention.cs | 24 +- .../OpenApiSchemaExtensions.cs | 23 + .../ResourceDataSchemaGenerator.cs | 22 +- .../ResourceFieldSchemaBuilder.cs | 8 +- .../ClientIdGenerationModesTests.cs | 36 +- .../Games/GamesRequestBuilder.cs | 8 +- ...st.cs => AttributesInCreateGameRequest.cs} | 12 +- ...> AttributesInCreatePlayerGroupRequest.cs} | 12 +- ....cs => AttributesInCreatePlayerRequest.cs} | 12 +- ...cument.cs => CreateGameRequestDocument.cs} | 24 +- .../CreatePlayerGroupRequestDocument.cs} | 26 +- .../Models/CreatePlayerRequestDocument.cs} | 26 +- ...tRequest.cs => DataInCreateGameRequest.cs} | 24 +- ...t.cs => DataInCreatePlayerGroupRequest.cs} | 36 +- ...equest.cs => DataInCreatePlayerRequest.cs} | 36 +- .../Models/GamePostRequestDocument.cs | 67 - ...elationshipsInCreatePlayerGroupRequest.cs} | 12 +- ... => RelationshipsInCreatePlayerRequest.cs} | 12 +- .../PlayerGroupsRequestBuilder.cs | 8 +- .../Players/PlayersRequestBuilder.cs | 8 +- .../Headers/ETagTests.cs | 6 +- .../Countries/CountriesRequestBuilder.cs | 8 +- .../Item/CountriesItemRequestBuilder.cs | 8 +- ...cs => AttributesInCreateCountryRequest.cs} | 12 +- ...cs => AttributesInUpdateCountryRequest.cs} | 12 +- .../Models/CountryPostRequestDocument.cs | 67 - .../Models/CreateCountryRequestDocument.cs | 26 +- ...quest.cs => DataInCreateCountryRequest.cs} | 36 +- ...quest.cs => DataInUpdateCountryRequest.cs} | 36 +- ...=> RelationshipsInCreateCountryRequest.cs} | 12 +- ...=> RelationshipsInUpdateCountryRequest.cs} | 12 +- .../Models/UpdateCountryRequestDocument.cs} | 26 +- .../Headers/HeaderTests.cs | 6 +- .../AccommodationsRequestBuilder.cs | 8 +- .../Item/AccommodationsItemRequestBuilder.cs | 8 +- .../Excursions/ExcursionsRequestBuilder.cs | 8 +- .../Item/ExcursionsItemRequestBuilder.cs | 8 +- ...AttributesInCreateAccommodationRequest.cs} | 12 +- ... => AttributesInCreateExcursionRequest.cs} | 12 +- ... => AttributesInCreateTransportRequest.cs} | 12 +- ...s => AttributesInCreateVacationRequest.cs} | 12 +- ...AttributesInUpdateAccommodationRequest.cs} | 12 +- ... => AttributesInUpdateExcursionRequest.cs} | 12 +- ... => AttributesInUpdateTransportRequest.cs} | 12 +- ...s => AttributesInUpdateVacationRequest.cs} | 12 +- ... => CreateAccommodationRequestDocument.cs} | 24 +- .../Models/CreateExcursionRequestDocument.cs} | 26 +- ...t.cs => CreateTransportRequestDocument.cs} | 24 +- ...nt.cs => CreateVacationRequestDocument.cs} | 24 +- ...cs => DataInCreateAccommodationRequest.cs} | 24 +- ...est.cs => DataInCreateExcursionRequest.cs} | 24 +- ...est.cs => DataInCreateTransportRequest.cs} | 24 +- ...uest.cs => DataInCreateVacationRequest.cs} | 36 +- ...cs => DataInUpdateAccommodationRequest.cs} | 24 +- ...est.cs => DataInUpdateExcursionRequest.cs} | 24 +- ...est.cs => DataInUpdateTransportRequest.cs} | 24 +- ...uest.cs => DataInUpdateVacationRequest.cs} | 36 +- ...> RelationshipsInCreateVacationRequest.cs} | 12 +- ...> RelationshipsInUpdateVacationRequest.cs} | 12 +- ... => UpdateAccommodationRequestDocument.cs} | 24 +- .../Models/UpdateExcursionRequestDocument.cs | 67 + .../Models/UpdateTransportRequestDocument.cs | 67 + ...nt.cs => UpdateVacationRequestDocument.cs} | 24 +- .../Models/VacationPatchRequestDocument.cs | 67 - .../Item/TransportsItemRequestBuilder.cs | 8 +- .../Transports/TransportsRequestBuilder.cs | 8 +- .../Item/VacationsItemRequestBuilder.cs | 8 +- .../Vacations/VacationsRequestBuilder.cs | 8 +- ...butesInCreateSocialMediaAccountRequest.cs} | 12 +- ...butesInUpdateSocialMediaAccountRequest.cs} | 12 +- ...reateSocialMediaAccountRequestDocument.cs} | 24 +- ... DataInCreateSocialMediaAccountRequest.cs} | 24 +- ... DataInUpdateSocialMediaAccountRequest.cs} | 24 +- ...UpdateSocialMediaAccountRequestDocument.cs | 67 + .../SocialMediaAccountsItemRequestBuilder.cs | 8 +- .../SocialMediaAccountsRequestBuilder.cs | 8 +- .../ModelStateValidationTests.cs | 90 +- ...AttributesInCreateNameValuePairRequest.cs} | 12 +- ...st.cs => AttributesInCreateNodeRequest.cs} | 12 +- ...AttributesInUpdateNameValuePairRequest.cs} | 12 +- ...st.cs => AttributesInUpdateNodeRequest.cs} | 12 +- ... => CreateNameValuePairRequestDocument.cs} | 24 +- .../Models/CreateNodeRequestDocument.cs | 26 +- ...cs => DataInCreateNameValuePairRequest.cs} | 36 +- ...tRequest.cs => DataInCreateNodeRequest.cs} | 36 +- ...cs => DataInUpdateNameValuePairRequest.cs} | 36 +- ...hRequest.cs => DataInUpdateNodeRequest.cs} | 36 +- ...ationshipsInCreateNameValuePairRequest.cs} | 12 +- ...cs => RelationshipsInCreateNodeRequest.cs} | 12 +- ...ationshipsInUpdateNameValuePairRequest.cs} | 12 +- ...cs => RelationshipsInUpdateNodeRequest.cs} | 12 +- .../UpdateNameValuePairRequestDocument.cs | 67 + ...cument.cs => UpdateNodeRequestDocument.cs} | 24 +- .../Item/NameValuePairsItemRequestBuilder.cs | 8 +- .../NameValuePairsRequestBuilder.cs | 8 +- .../Nodes/Item/NodesItemRequestBuilder.cs | 8 +- .../Nodes/NodesRequestBuilder.cs | 8 +- .../CreateResourceTests.cs | 18 +- ...ributesInCreateWriteOnlyChannelRequest.cs} | 12 +- ...ributesInUpdateWriteOnlyChannelRequest.cs} | 12 +- .../CreateWriteOnlyChannelRequestDocument.cs} | 26 +- ...=> DataInCreateWriteOnlyChannelRequest.cs} | 36 +- ...=> DataInUpdateWriteOnlyChannelRequest.cs} | 36 +- ...onshipsInCreateWriteOnlyChannelRequest.cs} | 12 +- ...onshipsInUpdateWriteOnlyChannelRequest.cs} | 12 +- ... UpdateWriteOnlyChannelRequestDocument.cs} | 24 +- .../WriteOnlyChannelPostRequestDocument.cs | 67 - .../WriteOnlyChannelsItemRequestBuilder.cs | 8 +- .../WriteOnlyChannelsRequestBuilder.cs | 8 +- .../UpdateResourceTests.cs | 24 +- ...tialAttributeSerializationLifetimeTests.cs | 104 +- .../LegacyOpenApi/RequestTests.cs | 52 +- .../LegacyOpenApi/ResponseTests.cs | 88 +- .../CamelCase/GeneratedTypesTests.cs | 54 +- .../KebabCase/GeneratedTypesTests.cs | 54 +- .../PascalCase/GeneratedTypesTests.cs | 54 +- .../CreateResourceTests.cs | 80 +- .../NrtOffMsvOffFakers.cs | 12 +- .../NullabilityTests.cs | 24 +- .../UpdateResourceTests.cs | 40 +- .../CreateResourceTests.cs | 100 +- .../NrtOffMsvOnFakers.cs | 12 +- .../NullabilityTests.cs | 24 +- .../UpdateResourceTests.cs | 40 +- .../CreateResourceTests.cs | 112 +- .../NrtOnMsvOffFakers.cs | 12 +- .../NullabilityTests.cs | 32 +- .../UpdateResourceTests.cs | 48 +- .../CreateResourceTests.cs | 116 +- .../NrtOnMsvOnFakers.cs | 12 +- .../NullabilityTests.cs | 32 +- .../UpdateResourceTests.cs | 48 +- .../ClientIdGenerationModesTests.cs | 36 +- .../Headers/ETagTests.cs | 6 +- .../Headers/HeaderTests.cs | 6 +- .../ModelStateValidationTests.cs | 84 +- .../CreateResourceTests.cs | 18 +- .../UpdateResourceTests.cs | 24 +- .../ClientIdGenerationTests.cs | 6 +- .../GeneratedSwagger/swagger.g.json | 408 +++--- .../Documentation/DocumentationTests.cs | 36 +- .../Headers/GeneratedSwagger/swagger.g.json | 222 +-- .../GeneratedSwagger/swagger.g.json | 1254 ++++++++--------- .../LegacyOpenApi/expected-swagger.json | 1254 ++++++++--------- .../Enabled/GeneratedSwagger/swagger.g.json | 1200 ++++++++-------- .../GeneratedSwagger/net6.0/swagger.g.json | 492 +++---- .../GeneratedSwagger/net8.0/swagger.g.json | 492 +++---- .../ModelStateValidationTests.cs | 4 +- .../CamelCase/CamelCaseTests.cs | 22 +- .../CamelCase/GeneratedSwagger/swagger.g.json | 636 ++++----- .../KebabCase/GeneratedSwagger/swagger.g.json | 636 ++++----- .../KebabCase/KebabCaseTests.cs | 20 +- .../GeneratedSwagger/swagger.g.json | 636 ++++----- .../PascalCase/PascalCaseTests.cs | 22 +- .../GeneratedSwagger/swagger.g.json | 658 ++++----- .../GeneratedSwagger/swagger.g.json | 432 +++--- .../NullabilityTests.cs | 4 +- .../ModelStateValidationOff/RequiredTests.cs | 8 +- .../GeneratedSwagger/swagger.g.json | 420 +++--- .../NullabilityTests.cs | 4 +- .../ModelStateValidationOn/RequiredTests.cs | 8 +- .../GeneratedSwagger/swagger.g.json | 512 +++---- .../NullabilityTests.cs | 4 +- .../ModelStateValidationOff/RequiredTests.cs | 8 +- .../GeneratedSwagger/swagger.g.json | 504 +++---- .../NullabilityTests.cs | 4 +- .../ModelStateValidationOn/RequiredTests.cs | 8 +- .../GeneratedSwagger/swagger.g.json | 356 ++--- 218 files changed, 7920 insertions(+), 7859 deletions(-) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonAttributesInPatchRequest.cs => AttributesInCreatePersonRequest.cs} (86%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagAttributesInPatchRequest.cs => AttributesInCreateTagRequest.cs} (83%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemAttributesInPatchRequest.cs => AttributesInCreateTodoItemRequest.cs} (86%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonAttributesInPostRequest.cs => AttributesInUpdatePersonRequest.cs} (86%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagAttributesInPostRequest.cs => AttributesInUpdateTagRequest.cs} (83%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemAttributesInPostRequest.cs => AttributesInUpdateTodoItemRequest.cs} (86%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemPostRequestDocument.cs => CreatePersonRequestDocument.cs} (73%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePatchRequestDocument.cs => src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs (71%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonPatchRequestDocument.cs => CreateTodoItemRequestDocument.cs} (67%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonDataInPostRequest.cs => DataInCreatePersonRequest.cs} (65%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagDataInPostRequest.cs => DataInCreateTagRequest.cs} (66%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemDataInPostRequest.cs => DataInCreateTodoItemRequest.cs} (64%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonDataInPatchRequest.cs => DataInUpdatePersonRequest.cs} (69%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagDataInPatchRequest.cs => DataInUpdateTagRequest.cs} (70%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemDataInPatchRequest.cs => DataInUpdateTodoItemRequest.cs} (68%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonRelationshipsInPatchRequest.cs => RelationshipsInCreatePersonRequest.cs} (87%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagRelationshipsInPatchRequest.cs => RelationshipsInCreateTagRequest.cs} (84%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemRelationshipsInPostRequest.cs => RelationshipsInCreateTodoItemRequest.cs} (88%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonRelationshipsInPostRequest.cs => RelationshipsInUpdatePersonRequest.cs} (87%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagRelationshipsInPostRequest.cs => RelationshipsInUpdateTagRequest.cs} (84%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemRelationshipsInPatchRequest.cs => RelationshipsInUpdateTodoItemRequest.cs} (88%) delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPostRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPostRequestDocument.cs => src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs (71%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagPatchRequestDocument.cs => UpdateTagRequestDocument.cs} (69%) create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/{ResourcePatchRequestDocument.cs => CreateResourceRequestDocument.cs} (74%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/{ResourcePostRequestDocument.cs => UpdateResourceRequestDocument.cs} (74%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{AttributesInPatchRequest.cs => AttributesInCreateResourceRequest.cs} (73%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{AttributesInPostRequest.cs => AttributesInUpdateResourceRequest.cs} (73%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{ResourceDataInPatchRequest.cs => DataInCreateResourceRequest.cs} (56%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{ResourceDataInPostRequest.cs => DataInUpdateResourceRequest.cs} (56%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{RelationshipsInPatchRequest.cs => RelationshipsInCreateResourceRequest.cs} (72%) rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{RelationshipsInPostRequest.cs => RelationshipsInUpdateResourceRequest.cs} (72%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{GameAttributesInPostRequest.cs => AttributesInCreateGameRequest.cs} (85%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerGroupAttributesInPostRequest.cs => AttributesInCreatePlayerGroupRequest.cs} (82%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerAttributesInPostRequest.cs => AttributesInCreatePlayerRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerPostRequestDocument.cs => CreateGameRequestDocument.cs} (73%) rename test/OpenApiKiotaEndToEndTests/{QueryStrings/GeneratedCode/Models/NameValuePairPostRequestDocument.cs => ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs} (69%) rename test/OpenApiKiotaEndToEndTests/{Headers/GeneratedCode/Models/CountryPatchRequestDocument.cs => ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs} (71%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{GameDataInPostRequest.cs => DataInCreateGameRequest.cs} (76%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerGroupDataInPostRequest.cs => DataInCreatePlayerGroupRequest.cs} (64%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerDataInPostRequest.cs => DataInCreatePlayerRequest.cs} (69%) delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePostRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerGroupRelationshipsInPostRequest.cs => RelationshipsInCreatePlayerGroupRequest.cs} (82%) rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerRelationshipsInPostRequest.cs => RelationshipsInCreatePlayerRequest.cs} (87%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryAttributesInPostRequest.cs => AttributesInCreateCountryRequest.cs} (84%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryAttributesInPatchRequest.cs => AttributesInUpdateCountryRequest.cs} (84%) delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPostRequestDocument.cs rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPatchRequestDocument.cs => test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs (71%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryDataInPostRequest.cs => DataInCreateCountryRequest.cs} (65%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryDataInPatchRequest.cs => DataInUpdateCountryRequest.cs} (69%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryRelationshipsInPatchRequest.cs => RelationshipsInCreateCountryRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{CountryRelationshipsInPostRequest.cs => RelationshipsInUpdateCountryRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/{Links/GeneratedCode/Models/TransportPostRequestDocument.cs => Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs} (71%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationAttributesInPatchRequest.cs => AttributesInCreateAccommodationRequest.cs} (81%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionAttributesInPatchRequest.cs => AttributesInCreateExcursionRequest.cs} (84%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportAttributesInPostRequest.cs => AttributesInCreateTransportRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationAttributesInPatchRequest.cs => AttributesInCreateVacationRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationAttributesInPostRequest.cs => AttributesInUpdateAccommodationRequest.cs} (81%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionAttributesInPostRequest.cs => AttributesInUpdateExcursionRequest.cs} (84%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportAttributesInPatchRequest.cs => AttributesInUpdateTransportRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationAttributesInPostRequest.cs => AttributesInUpdateVacationRequest.cs} (83%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationPatchRequestDocument.cs => CreateAccommodationRequestDocument.cs} (66%) rename test/OpenApiKiotaEndToEndTests/{ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPostRequestDocument.cs => Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs} (71%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionPostRequestDocument.cs => CreateTransportRequestDocument.cs} (67%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportPatchRequestDocument.cs => CreateVacationRequestDocument.cs} (73%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationDataInPostRequest.cs => DataInCreateAccommodationRequest.cs} (70%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionDataInPostRequest.cs => DataInCreateExcursionRequest.cs} (71%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportDataInPostRequest.cs => DataInCreateTransportRequest.cs} (71%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationDataInPostRequest.cs => DataInCreateVacationRequest.cs} (64%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationDataInPatchRequest.cs => DataInUpdateAccommodationRequest.cs} (74%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionDataInPatchRequest.cs => DataInUpdateExcursionRequest.cs} (75%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportDataInPatchRequest.cs => DataInUpdateTransportRequest.cs} (75%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationDataInPatchRequest.cs => DataInUpdateVacationRequest.cs} (68%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationRelationshipsInPatchRequest.cs => RelationshipsInCreateVacationRequest.cs} (89%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{VacationRelationshipsInPostRequest.cs => RelationshipsInUpdateVacationRequest.cs} (89%) rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationPostRequestDocument.cs => UpdateAccommodationRequestDocument.cs} (66%) create mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionPatchRequestDocument.cs => UpdateVacationRequestDocument.cs} (73%) delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPatchRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{SocialMediaAccountAttributesInPatchRequest.cs => AttributesInCreateSocialMediaAccountRequest.cs} (95%) rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{SocialMediaAccountAttributesInPostRequest.cs => AttributesInUpdateSocialMediaAccountRequest.cs} (95%) rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{SocialMediaAccountPatchRequestDocument.cs => CreateSocialMediaAccountRequestDocument.cs} (64%) rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{SocialMediaAccountDataInPostRequest.cs => DataInCreateSocialMediaAccountRequest.cs} (69%) rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{SocialMediaAccountDataInPatchRequest.cs => DataInUpdateSocialMediaAccountRequest.cs} (73%) create mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairAttributesInPatchRequest.cs => AttributesInCreateNameValuePairRequest.cs} (84%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeAttributesInPatchRequest.cs => AttributesInCreateNodeRequest.cs} (86%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairAttributesInPostRequest.cs => AttributesInUpdateNameValuePairRequest.cs} (84%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeAttributesInPostRequest.cs => AttributesInUpdateNodeRequest.cs} (86%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairPatchRequestDocument.cs => CreateNameValuePairRequestDocument.cs} (66%) rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPostRequestDocument.cs => test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs (71%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairDataInPostRequest.cs => DataInCreateNameValuePairRequest.cs} (63%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeDataInPostRequest.cs => DataInCreateNodeRequest.cs} (66%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairDataInPatchRequest.cs => DataInUpdateNameValuePairRequest.cs} (67%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeDataInPatchRequest.cs => DataInUpdateNodeRequest.cs} (69%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairRelationshipsInPatchRequest.cs => RelationshipsInCreateNameValuePairRequest.cs} (82%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeRelationshipsInPatchRequest.cs => RelationshipsInCreateNodeRequest.cs} (89%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairRelationshipsInPostRequest.cs => RelationshipsInUpdateNameValuePairRequest.cs} (82%) rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeRelationshipsInPostRequest.cs => RelationshipsInUpdateNodeRequest.cs} (89%) create mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodePostRequestDocument.cs => UpdateNodeRequestDocument.cs} (68%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelAttributesInPatchRequest.cs => AttributesInCreateWriteOnlyChannelRequest.cs} (85%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelAttributesInPostRequest.cs => AttributesInUpdateWriteOnlyChannelRequest.cs} (85%) rename test/OpenApiKiotaEndToEndTests/{ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPostRequestDocument.cs => RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs} (69%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelDataInPostRequest.cs => DataInCreateWriteOnlyChannelRequest.cs} (63%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelDataInPatchRequest.cs => DataInUpdateWriteOnlyChannelRequest.cs} (67%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelRelationshipsInPatchRequest.cs => RelationshipsInCreateWriteOnlyChannelRequest.cs} (89%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelRelationshipsInPostRequest.cs => RelationshipsInUpdateWriteOnlyChannelRequest.cs} (89%) rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{WriteOnlyChannelPatchRequestDocument.cs => UpdateWriteOnlyChannelRequestDocument.cs} (65%) delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPostRequestDocument.cs diff --git a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json index 5cbace7811..5924064de8 100644 --- a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json +++ b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/personPostRequestDocument" + "$ref": "#/components/schemas/createPersonRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/personPatchRequestDocument" + "$ref": "#/components/schemas/updatePersonRequestDocument" } ] } @@ -1847,7 +1847,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/tagPostRequestDocument" + "$ref": "#/components/schemas/createTagRequestDocument" } ] } @@ -2142,7 +2142,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/tagPatchRequestDocument" + "$ref": "#/components/schemas/updateTagRequestDocument" } ] } @@ -2962,7 +2962,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/todoItemPostRequestDocument" + "$ref": "#/components/schemas/createTodoItemRequestDocument" } ] } @@ -3257,7 +3257,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/todoItemPatchRequestDocument" + "$ref": "#/components/schemas/updateTodoItemRequestDocument" } ] } @@ -4742,6 +4742,230 @@ }, "components": { "schemas": { + "attributesInCreatePersonRequest": { + "required": [ + "lastName" + ], + "type": "object", + "properties": { + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "attributesInCreateTagRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "attributesInCreateTodoItemRequest": { + "required": [ + "description", + "priority" + ], + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "priority": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemPriority" + } + ] + }, + "durationInHours": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdatePersonRequest": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "attributesInUpdateTagRequest": { + "type": "object", + "properties": { + "name": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "attributesInUpdateTodoItemRequest": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "priority": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemPriority" + } + ] + }, + "durationInHours": { + "type": "integer", + "format": "int64", + "nullable": true + } + }, + "additionalProperties": false + }, + "createPersonRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreatePersonRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createTagRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTagRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createTodoItemRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTodoItemRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreatePersonRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/personResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreatePersonRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreatePersonRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateTagRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/tagResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateTagRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateTagRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateTodoItemRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/todoItemResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateTodoItemRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateTodoItemRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -4769,6 +4993,99 @@ }, "x-abstract": true }, + "dataInUpdatePersonRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/personResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdatePersonRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdatePersonRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateTagRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/tagResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateTagRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateTagRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateTodoItemRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/todoItemResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateTodoItemRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateTodoItemRequest" + } + ] + } + }, + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -5004,35 +5321,6 @@ }, "additionalProperties": false }, - "personAttributesInPatchRequest": { - "type": "object", - "properties": { - "firstName": { - "type": "string", - "nullable": true - }, - "lastName": { - "type": "string" - } - }, - "additionalProperties": false - }, - "personAttributesInPostRequest": { - "required": [ - "lastName" - ], - "type": "object", - "properties": { - "firstName": { - "type": "string", - "nullable": true - }, - "lastName": { - "type": "string" - } - }, - "additionalProperties": false - }, "personAttributesInResponse": { "type": "object", "properties": { @@ -5057,88 +5345,31 @@ ], "type": "object", "properties": { - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" - } - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/personDataInResponse" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/dataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "personDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/personResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/personAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/personRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "personDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/personResourceType" - }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/personAttributesInPostRequest" + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" } ] }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/personRelationshipsInPostRequest" - } - ] + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/personDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -5233,39 +5464,71 @@ }, "additionalProperties": false }, - "personPatchRequestDocument": { + "personPrimaryResponseDocument": { "required": [ - "data" + "data", + "links" ], "type": "object", "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, "data": { "allOf": [ { - "$ref": "#/components/schemas/personDataInPatchRequest" + "$ref": "#/components/schemas/personDataInResponse" } ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false }, - "personPostRequestDocument": { - "required": [ - "data" - ], + "personRelationshipsInResponse": { "type": "object", "properties": { - "data": { + "ownedTodoItems": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTodoItemInResponse" + } + ] + }, + "assignedTodoItems": { "allOf": [ { - "$ref": "#/components/schemas/personDataInPostRequest" + "$ref": "#/components/schemas/toManyTodoItemInResponse" } ] } }, "additionalProperties": false }, - "personPrimaryResponseDocument": { + "personResourceType": { + "enum": [ + "people" + ], + "type": "string", + "additionalProperties": false + }, + "personSecondaryResponseDocument": { "required": [ "data", "links" @@ -5302,7 +5565,19 @@ }, "additionalProperties": false }, - "personRelationshipsInPatchRequest": { + "relationshipLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "related": { + "type": "string" + } + }, + "additionalProperties": false + }, + "relationshipsInCreatePersonRequest": { "type": "object", "properties": { "ownedTodoItems": { @@ -5322,98 +5597,105 @@ }, "additionalProperties": false }, - "personRelationshipsInPostRequest": { + "relationshipsInCreateTagRequest": { "type": "object", "properties": { - "ownedTodoItems": { + "todoItems": { "allOf": [ { "$ref": "#/components/schemas/toManyTodoItemInRequest" } ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreateTodoItemRequest": { + "required": [ + "owner" + ], + "type": "object", + "properties": { + "owner": { + "allOf": [ + { + "$ref": "#/components/schemas/toOnePersonInRequest" + } + ] }, - "assignedTodoItems": { + "assignee": { "allOf": [ { - "$ref": "#/components/schemas/toManyTodoItemInRequest" + "$ref": "#/components/schemas/nullableToOnePersonInRequest" + } + ] + }, + "tags": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTagInRequest" } ] } }, "additionalProperties": false }, - "personRelationshipsInResponse": { + "relationshipsInUpdatePersonRequest": { "type": "object", "properties": { "ownedTodoItems": { "allOf": [ { - "$ref": "#/components/schemas/toManyTodoItemInResponse" + "$ref": "#/components/schemas/toManyTodoItemInRequest" } ] }, "assignedTodoItems": { "allOf": [ { - "$ref": "#/components/schemas/toManyTodoItemInResponse" + "$ref": "#/components/schemas/toManyTodoItemInRequest" } ] } }, "additionalProperties": false }, - "personResourceType": { - "enum": [ - "people" - ], - "type": "string", + "relationshipsInUpdateTagRequest": { + "type": "object", + "properties": { + "todoItems": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTodoItemInRequest" + } + ] + } + }, "additionalProperties": false }, - "personSecondaryResponseDocument": { - "required": [ - "data", - "links" - ], + "relationshipsInUpdateTodoItemRequest": { "type": "object", "properties": { - "links": { + "owner": { "allOf": [ { - "$ref": "#/components/schemas/resourceTopLevelLinks" + "$ref": "#/components/schemas/toOnePersonInRequest" } ] }, - "data": { + "assignee": { "allOf": [ { - "$ref": "#/components/schemas/personDataInResponse" + "$ref": "#/components/schemas/nullableToOnePersonInRequest" } ] }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/dataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "relationshipLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - }, - "related": { - "type": "string" + "tags": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTagInRequest" + } + ] } }, "additionalProperties": false @@ -5505,29 +5787,6 @@ }, "additionalProperties": false }, - "tagAttributesInPatchRequest": { - "type": "object", - "properties": { - "name": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, - "tagAttributesInPostRequest": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "tagAttributesInResponse": { "type": "object", "properties": { @@ -5560,73 +5819,16 @@ }, "included": { "type": "array", - "items": { - "$ref": "#/components/schemas/dataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "tagDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/tagResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/tagAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/tagRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "tagDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/tagResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/tagAttributesInPostRequest" - } - ] + "items": { + "$ref": "#/components/schemas/dataInResponse" + } }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/tagRelationshipsInPostRequest" - } - ] + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -5720,38 +5922,6 @@ }, "additionalProperties": false }, - "tagPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/tagDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "tagPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/tagDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "tagPrimaryResponseDocument": { "required": [ "data", @@ -5789,32 +5959,6 @@ }, "additionalProperties": false }, - "tagRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "todoItems": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyTodoItemInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "tagRelationshipsInPostRequest": { - "type": "object", - "properties": { - "todoItems": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyTodoItemInRequest" - } - ] - } - }, - "additionalProperties": false - }, "tagRelationshipsInResponse": { "type": "object", "properties": { @@ -5960,52 +6104,6 @@ }, "additionalProperties": false }, - "todoItemAttributesInPatchRequest": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "priority": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemPriority" - } - ] - }, - "durationInHours": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - "additionalProperties": false - }, - "todoItemAttributesInPostRequest": { - "required": [ - "description", - "priority" - ], - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "priority": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemPriority" - } - ] - }, - "durationInHours": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - "additionalProperties": false - }, "todoItemAttributesInResponse": { "type": "object", "properties": { @@ -6072,63 +6170,6 @@ }, "additionalProperties": false }, - "todoItemDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/todoItemResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "todoItemDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/todoItemResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "todoItemDataInResponse": { "allOf": [ { @@ -6218,38 +6259,6 @@ }, "additionalProperties": false }, - "todoItemPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "todoItemPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/todoItemDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "todoItemPrimaryResponseDocument": { "required": [ "data", @@ -6295,96 +6304,87 @@ ], "type": "string" }, - "todoItemRelationshipsInPatchRequest": { + "todoItemRelationshipsInResponse": { "type": "object", "properties": { "owner": { "allOf": [ { - "$ref": "#/components/schemas/toOnePersonInRequest" + "$ref": "#/components/schemas/toOnePersonInResponse" } ] }, "assignee": { "allOf": [ { - "$ref": "#/components/schemas/nullableToOnePersonInRequest" + "$ref": "#/components/schemas/nullableToOnePersonInResponse" } ] }, "tags": { "allOf": [ { - "$ref": "#/components/schemas/toManyTagInRequest" + "$ref": "#/components/schemas/toManyTagInResponse" } ] } }, "additionalProperties": false }, - "todoItemRelationshipsInPostRequest": { + "todoItemResourceType": { + "enum": [ + "todoItems" + ], + "type": "string", + "additionalProperties": false + }, + "updatePersonRequestDocument": { "required": [ - "owner" + "data" ], "type": "object", "properties": { - "owner": { - "allOf": [ - { - "$ref": "#/components/schemas/toOnePersonInRequest" - } - ] - }, - "assignee": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOnePersonInRequest" - } - ] - }, - "tags": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/toManyTagInRequest" + "$ref": "#/components/schemas/dataInUpdatePersonRequest" } ] } }, "additionalProperties": false }, - "todoItemRelationshipsInResponse": { + "updateTagRequestDocument": { + "required": [ + "data" + ], "type": "object", "properties": { - "owner": { - "allOf": [ - { - "$ref": "#/components/schemas/toOnePersonInResponse" - } - ] - }, - "assignee": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/nullableToOnePersonInResponse" + "$ref": "#/components/schemas/dataInUpdateTagRequest" } ] - }, - "tags": { + } + }, + "additionalProperties": false + }, + "updateTodoItemRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/toManyTagInResponse" + "$ref": "#/components/schemas/dataInUpdateTodoItemRequest" } ] } }, "additionalProperties": false - }, - "todoItemResourceType": { - "enum": [ - "todoItems" - ], - "type": "string", - "additionalProperties": false } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs index 7cf26c0077..b485a3249d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs @@ -125,11 +125,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(PersonPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(PersonPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -207,11 +207,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(PersonPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdatePersonRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(PersonPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdatePersonRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs index c850739a21..03e061ad10 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(PersonPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(PersonPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(PersonPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePersonRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(PersonPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePersonRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs index 51099babf6..8e61929887 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs @@ -119,11 +119,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(TagPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(TagPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -201,11 +201,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(TagPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTagRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(TagPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTagRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs index e603439137..fb76bf8715 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(TagPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(TagPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(TagPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTagRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(TagPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTagRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs index d29653bbef..516026cdd2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs @@ -131,11 +131,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(TodoItemPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(TodoItemPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -213,11 +213,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(TodoItemPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(TodoItemPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTodoItemRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs index ddefb1b180..1bfd200d9a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(TodoItemPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(TodoItemPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(TodoItemPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTodoItemRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(TodoItemPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTodoItemRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs similarity index 86% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs index d6747a8b49..6cdc9d6683 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string LastName { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonAttributesInPatchRequest() + public AttributesInCreatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonAttributesInPatchRequest(); + return new AttributesInCreatePersonRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs similarity index 83% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs index 6762f0c6c3..4c6d3a79f4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagAttributesInPatchRequest() + public AttributesInCreateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagAttributesInPatchRequest(); + return new AttributesInCreateTagRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs similarity index 86% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs index 98e01d58c9..f9e2c63b05 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -37,21 +37,21 @@ public TodoItemPriority? Priority { set { BackingStore?.Set("priority", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemAttributesInPatchRequest() + public AttributesInCreateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemAttributesInPatchRequest(); + return new AttributesInCreateTodoItemRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs similarity index 86% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs index c426286204..ea3b5f10e3 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string LastName { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonAttributesInPostRequest() + public AttributesInUpdatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonAttributesInPostRequest(); + return new AttributesInUpdatePersonRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs similarity index 83% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs index 5e4445ec6b..63b1205863 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagAttributesInPostRequest() + public AttributesInUpdateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagAttributesInPostRequest(); + return new AttributesInUpdateTagRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs similarity index 86% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs index ba611ad005..7f1eaf8d15 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -37,21 +37,21 @@ public TodoItemPriority? Priority { set { BackingStore?.Set("priority", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemAttributesInPostRequest() + public AttributesInUpdateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemAttributesInPostRequest(); + return new AttributesInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPostRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs similarity index 73% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPostRequestDocument.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs index c551fb2e40..975aafc687 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPostRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemPostRequestDocument : IBackedModel, IParsable + public class CreatePersonRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class TodoItemPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePersonRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TodoItemDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePersonRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemPostRequestDocument() + public CreatePersonRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemPostRequestDocument(); + return new CreatePersonRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TodoItemDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreatePersonRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePatchRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePatchRequestDocument.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs index 9541e859f6..7bd33dceb3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePatchRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodePatchRequestDocument : IBackedModel, IParsable + public class CreateTagRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class NodePatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTagRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTagRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodePatchRequestDocument() + public CreateTagRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodePatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodePatchRequestDocument(); + return new CreateTagRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateTagRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPatchRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs similarity index 67% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPatchRequestDocument.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs index d9a58adabf..4244ed11c1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPatchRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonPatchRequestDocument : IBackedModel, IParsable + public class CreateTodoItemRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class PersonPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTodoItemRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTodoItemRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonPatchRequestDocument() + public CreateTodoItemRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonPatchRequestDocument(); + return new CreateTodoItemRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs similarity index 65% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs index bc9948a355..0a3897aff4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonDataInPostRequest : IBackedModel, IParsable + public class DataInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePersonRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PersonAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePersonRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public PersonAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePersonRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PersonRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePersonRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public PersonResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonDataInPostRequest() + public DataInCreatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonDataInPostRequest(); + return new DataInCreatePersonRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePersonRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs similarity index 66% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs index ecd148f71c..8231f3c6c9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagDataInPostRequest : IBackedModel, IParsable + public class DataInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTagRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TagAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTagRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public TagAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateTagRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TagRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateTagRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public TagResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagDataInPostRequest() + public DataInCreateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagDataInPostRequest(); + return new DataInCreateTagRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TagAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TagRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTagRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateTagRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs similarity index 64% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs index 4691ae5356..b4899591ba 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemDataInPostRequest : IBackedModel, IParsable + public class DataInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTodoItemRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TodoItemAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTodoItemRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public TodoItemAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateTodoItemRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TodoItemRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateTodoItemRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public TodoItemResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemDataInPostRequest() + public DataInCreateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemDataInPostRequest(); + return new DataInCreateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TodoItemAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TodoItemRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs similarity index 69% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs index 6ba7f4ddb7..3a368b46b9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdatePersonRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PersonAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdatePersonRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdatePersonRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PersonRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdatePersonRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public PersonResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonDataInPatchRequest() + public DataInUpdatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonDataInPatchRequest(); + return new DataInUpdatePersonRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs similarity index 70% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs index 2907745744..6aa61a09b8 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTagRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TagAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTagRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateTagRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TagRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateTagRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public TagResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagDataInPatchRequest() + public DataInUpdateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagDataInPatchRequest(); + return new DataInUpdateTagRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TagAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTagRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TagRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateTagRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs similarity index 68% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs index 81023e7f58..ec76541613 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTodoItemRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TodoItemAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTodoItemRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateTodoItemRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TodoItemRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateTodoItemRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public TodoItemResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemDataInPatchRequest() + public DataInUpdateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemDataInPatchRequest(); + return new DataInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TodoItemAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TodoItemRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs similarity index 87% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs index a601620864..ddaff97212 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignedTodoItems property @@ -41,21 +41,21 @@ public ToManyTodoItemInRequest OwnedTodoItems { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonRelationshipsInPatchRequest() + public RelationshipsInCreatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonRelationshipsInPatchRequest(); + return new RelationshipsInCreatePersonRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs similarity index 84% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs index 779da82682..71445d3c86 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToManyTodoItemInRequest TodoItems { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagRelationshipsInPatchRequest() + public RelationshipsInCreateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagRelationshipsInPatchRequest(); + return new RelationshipsInCreateTagRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs similarity index 88% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs index 6c3c8ecbb2..c5ea5aa713 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignee property @@ -55,21 +55,21 @@ public ToManyTagInRequest Tags { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemRelationshipsInPostRequest() + public RelationshipsInCreateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemRelationshipsInPostRequest(); + return new RelationshipsInCreateTodoItemRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs similarity index 87% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs index 703bc2bad8..b58750b5b5 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignedTodoItems property @@ -41,21 +41,21 @@ public ToManyTodoItemInRequest OwnedTodoItems { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonRelationshipsInPostRequest() + public RelationshipsInUpdatePersonRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonRelationshipsInPostRequest(); + return new RelationshipsInUpdatePersonRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPostRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs similarity index 84% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPostRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs index f364ea711d..2376bdabf3 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInPostRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToManyTodoItemInRequest TodoItems { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagRelationshipsInPostRequest() + public RelationshipsInUpdateTagRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagRelationshipsInPostRequest(); + return new RelationshipsInUpdateTagRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPatchRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs similarity index 88% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPatchRequest.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs index 8d95e58039..0596dbd58f 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInPatchRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignee property @@ -55,21 +55,21 @@ public ToManyTagInRequest Tags { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemRelationshipsInPatchRequest() + public RelationshipsInUpdateTodoItemRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemRelationshipsInPatchRequest(); + return new RelationshipsInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPostRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPostRequestDocument.cs deleted file mode 100644 index e5c77733c9..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPostRequestDocument.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class TagPostRequestDocument : IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// The data property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TagDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#nullable restore -#else - public TagDataInPostRequest Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public TagPostRequestDocument() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static TagPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagPostRequestDocument(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"data", n => { Data = n.GetObjectValue(TagDataInPostRequest.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPostRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPostRequestDocument.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs index 31d476108d..ff1dc40a0d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPostRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationPostRequestDocument : IBackedModel, IParsable + public class UpdatePersonRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class VacationPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdatePersonRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public VacationDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdatePersonRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationPostRequestDocument() + public UpdatePersonRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationPostRequestDocument(); + return new UpdatePersonRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(VacationDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPatchRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs similarity index 69% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPatchRequestDocument.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs index 6ccf603292..01d122b7b0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPatchRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagPatchRequestDocument : IBackedModel, IParsable + public class UpdateTagRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class TagPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateTagRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TagDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateTagRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagPatchRequestDocument() + public UpdateTagRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagPatchRequestDocument(); + return new UpdateTagRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TagDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateTagRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs new file mode 100644 index 0000000000..50faf9e965 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models { + #pragma warning disable CS1591 + public class UpdateTodoItemRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DataInUpdateTodoItemRequest? Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public DataInUpdateTodoItemRequest Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateTodoItemRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpdateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateTodoItemRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"data", n => { Data = n.GetObjectValue(DataInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/Worker.cs b/src/Examples/OpenApiKiotaClientExample/Worker.cs index 05b6f597f4..656eb3498c 100644 --- a/src/Examples/OpenApiKiotaClientExample/Worker.cs +++ b/src/Examples/OpenApiKiotaClientExample/Worker.cs @@ -83,13 +83,13 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) private async Task UpdatePersonAsync(CancellationToken cancellationToken) { - var patchRequest = new PersonPatchRequestDocument + var patchRequest = new UpdatePersonRequestDocument { - Data = new PersonDataInPatchRequest + Data = new DataInUpdatePersonRequest { Type = PersonResourceType.People, Id = "1", - Attributes = new PersonAttributesInPatchRequest + Attributes = new AttributesInUpdatePersonRequest { LastName = "Doe" } diff --git a/src/Examples/OpenApiNSwagClientExample/Worker.cs b/src/Examples/OpenApiNSwagClientExample/Worker.cs index 14958e7923..413bd8b299 100644 --- a/src/Examples/OpenApiNSwagClientExample/Worker.cs +++ b/src/Examples/OpenApiNSwagClientExample/Worker.cs @@ -50,12 +50,12 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) private async Task UpdatePersonAsync(CancellationToken cancellationToken) { - var patchRequest = new PersonPatchRequestDocument + var patchRequest = new UpdatePersonRequestDocument { - Data = new PersonDataInPatchRequest + Data = new DataInUpdatePersonRequest { Id = "1", - Attributes = new PersonAttributesInPatchRequest + Attributes = new AttributesInUpdatePersonRequest { LastName = "Doe" } @@ -63,7 +63,7 @@ private async Task UpdatePersonAsync(CancellationToken cancellationToken) }; // This line results in sending "firstName: null" instead of omitting it. - using (_apiClient.WithPartialAttributeSerialization(patchRequest, + using (_apiClient.WithPartialAttributeSerialization(patchRequest, person => person.FirstName)) { _ = await ApiResponse.TranslateAsync(async () => await _apiClient.PatchPersonAsync(patchRequest.Data.Id, null, patchRequest, cancellationToken)); diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs index afd2608c84..8576e8fb2d 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs @@ -203,6 +203,6 @@ private static void RemovePathParameter(ICollection paramet private static void ExpandTemplate(AttributeRouteInfo route, string expansionParameter) { - route.Template = route.Template!.Replace(JsonApiRoutingTemplate.RelationshipNameUrlPlaceholder, expansionParameter); + route.Template = route.Template!.Replace(JsonApiRoutingTemplate.RelationshipNameRoutePlaceholder, expansionParameter); } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs index 6a1ad46d13..a1135e492c 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs @@ -6,12 +6,10 @@ internal enum JsonApiEndpoint GetSingle, GetSecondary, GetRelationship, - Post, + PostResource, PostRelationship, - Patch, + PatchResource, PatchRelationship, -#pragma warning disable AV1711 // Name members and local functions similarly to members of .NET Framework classes - Delete, -#pragma warning restore AV1711 // Name members and local functions similarly to members of .NET Framework classes + DeleteResource, DeleteRelationship } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs index fe4f9153d8..132965123e 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs @@ -45,19 +45,19 @@ private static bool IsOperationsController(MethodInfo controllerAction) }, HttpPostAttribute attr => attr.Template switch { - null => JsonApiEndpoint.Post, + null => JsonApiEndpoint.PostResource, JsonApiRoutingTemplate.RelationshipEndpoint => JsonApiEndpoint.PostRelationship, _ => null }, HttpPatchAttribute attr => attr.Template switch { - JsonApiRoutingTemplate.PrimaryEndpoint => JsonApiEndpoint.Patch, + JsonApiRoutingTemplate.PrimaryEndpoint => JsonApiEndpoint.PatchResource, JsonApiRoutingTemplate.RelationshipEndpoint => JsonApiEndpoint.PatchRelationship, _ => null }, HttpDeleteAttribute attr => attr.Template switch { - JsonApiRoutingTemplate.PrimaryEndpoint => JsonApiEndpoint.Delete, + JsonApiRoutingTemplate.PrimaryEndpoint => JsonApiEndpoint.DeleteResource, JsonApiRoutingTemplate.RelationshipEndpoint => JsonApiEndpoint.DeleteRelationship, _ => null }, diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs index c56b881955..034bfb322f 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs @@ -55,24 +55,24 @@ public JsonApiEndpointMetadataContainer Get(MethodInfo controllerAction) { return endpoint switch { - JsonApiEndpoint.Post => GetPostRequestMetadata(primaryResourceType.ClrType), - JsonApiEndpoint.Patch => GetPatchRequestMetadata(primaryResourceType.ClrType), + JsonApiEndpoint.PostResource => GetPostResourceRequestMetadata(primaryResourceType.ClrType), + JsonApiEndpoint.PatchResource => GetPatchResourceRequestMetadata(primaryResourceType.ClrType), JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship => GetRelationshipRequestMetadata( primaryResourceType.Relationships, endpoint != JsonApiEndpoint.PatchRelationship), _ => null }; } - private static PrimaryRequestMetadata GetPostRequestMetadata(Type resourceClrType) + private static PrimaryRequestMetadata GetPostResourceRequestMetadata(Type resourceClrType) { - Type documentType = typeof(ResourcePostRequestDocument<>).MakeGenericType(resourceClrType); + Type documentType = typeof(CreateResourceRequestDocument<>).MakeGenericType(resourceClrType); return new PrimaryRequestMetadata(documentType); } - private static PrimaryRequestMetadata GetPatchRequestMetadata(Type resourceClrType) + private static PrimaryRequestMetadata GetPatchResourceRequestMetadata(Type resourceClrType) { - Type documentType = typeof(ResourcePatchRequestDocument<>).MakeGenericType(resourceClrType); + Type documentType = typeof(UpdateResourceRequestDocument<>).MakeGenericType(resourceClrType); return new PrimaryRequestMetadata(documentType); } @@ -91,8 +91,8 @@ private RelationshipRequestMetadata GetRelationshipRequestMetadata(IEnumerable GetPrimaryResponseMetadata( - primaryResourceType.ClrType, endpoint == JsonApiEndpoint.GetCollection), + JsonApiEndpoint.GetCollection or JsonApiEndpoint.GetSingle or JsonApiEndpoint.PostResource or JsonApiEndpoint.PatchResource => + GetPrimaryResponseMetadata(primaryResourceType.ClrType, endpoint == JsonApiEndpoint.GetCollection), JsonApiEndpoint.GetSecondary => GetSecondaryResponseMetadata(primaryResourceType.Relationships), JsonApiEndpoint.GetRelationship => GetRelationshipResponseMetadata(primaryResourceType.Relationships), _ => null diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePatchRequestDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/CreateResourceRequestDocument.cs similarity index 74% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePatchRequestDocument.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/CreateResourceRequestDocument.cs index cb51ab223b..9823699e9e 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePatchRequestDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/CreateResourceRequestDocument.cs @@ -7,10 +7,10 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; [UsedImplicitly(ImplicitUseTargetFlags.Members)] -internal sealed class ResourcePatchRequestDocument +internal sealed class CreateResourceRequestDocument where TResource : IIdentifiable { [Required] [JsonPropertyName("data")] - public ResourceDataInPatchRequest Data { get; set; } = null!; + public DataInCreateResourceRequest Data { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePostRequestDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/UpdateResourceRequestDocument.cs similarity index 74% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePostRequestDocument.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/UpdateResourceRequestDocument.cs index d00e215597..755ba7a178 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourcePostRequestDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/UpdateResourceRequestDocument.cs @@ -7,10 +7,10 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; [UsedImplicitly(ImplicitUseTargetFlags.Members)] -internal sealed class ResourcePostRequestDocument +internal sealed class UpdateResourceRequestDocument where TResource : IIdentifiable { [Required] [JsonPropertyName("data")] - public ResourceDataInPostRequest Data { get; set; } = null!; + public DataInUpdateResourceRequest Data { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs index 55be9d1e49..5e8f19978f 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs @@ -9,8 +9,8 @@ internal static class JsonApiSchemaFacts { private static readonly Type[] RequestSchemaTypes = [ - typeof(ResourcePostRequestDocument<>), - typeof(ResourcePatchRequestDocument<>), + typeof(CreateResourceRequestDocument<>), + typeof(UpdateResourceRequestDocument<>), typeof(ToOneRelationshipInRequest<>), typeof(NullableToOneRelationshipInRequest<>), typeof(ToManyRelationshipInRequest<>) diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPatchRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInCreateResourceRequest.cs similarity index 73% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPatchRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInCreateResourceRequest.cs index bbf797a830..83ce260938 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPatchRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInCreateResourceRequest.cs @@ -3,5 +3,5 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; // ReSharper disable once UnusedTypeParameter -internal sealed class AttributesInPatchRequest +internal sealed class AttributesInCreateResourceRequest where TResource : IIdentifiable; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPostRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInUpdateResourceRequest.cs similarity index 73% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPostRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInUpdateResourceRequest.cs index cea0fa0240..82f39f8c07 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInPostRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/AttributesInUpdateResourceRequest.cs @@ -3,5 +3,5 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; // ReSharper disable once UnusedTypeParameter -internal sealed class AttributesInPostRequest +internal sealed class AttributesInUpdateResourceRequest where TResource : IIdentifiable; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPatchRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs similarity index 56% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPatchRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs index 248433afc4..0b846ea204 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPatchRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs @@ -5,12 +5,12 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; [UsedImplicitly(ImplicitUseTargetFlags.Members)] -internal sealed class ResourceDataInPatchRequest : ResourceData +internal sealed class DataInCreateResourceRequest : ResourceData where TResource : IIdentifiable { [JsonPropertyName("attributes")] - public AttributesInPatchRequest Attributes { get; set; } = null!; + public AttributesInCreateResourceRequest Attributes { get; set; } = null!; [JsonPropertyName("relationships")] - public RelationshipsInPatchRequest Relationships { get; set; } = null!; + public RelationshipsInCreateResourceRequest Relationships { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPostRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs similarity index 56% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPostRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs index 7310620ad0..34645f24aa 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInPostRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs @@ -5,12 +5,12 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; [UsedImplicitly(ImplicitUseTargetFlags.Members)] -internal sealed class ResourceDataInPostRequest : ResourceData +internal sealed class DataInUpdateResourceRequest : ResourceData where TResource : IIdentifiable { [JsonPropertyName("attributes")] - public AttributesInPostRequest Attributes { get; set; } = null!; + public AttributesInUpdateResourceRequest Attributes { get; set; } = null!; [JsonPropertyName("relationships")] - public RelationshipsInPostRequest Relationships { get; set; } = null!; + public RelationshipsInUpdateResourceRequest Relationships { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPatchRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInCreateResourceRequest.cs similarity index 72% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPatchRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInCreateResourceRequest.cs index 7903376997..54808202ef 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPatchRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInCreateResourceRequest.cs @@ -3,5 +3,5 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; // ReSharper disable once UnusedTypeParameter -internal sealed class RelationshipsInPatchRequest +internal sealed class RelationshipsInCreateResourceRequest where TResource : IIdentifiable; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPostRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInUpdateResourceRequest.cs similarity index 72% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPostRequest.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInUpdateResourceRequest.cs index d5ba6fb280..7cc983a64f 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInPostRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipsInUpdateResourceRequest.cs @@ -3,5 +3,5 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; // ReSharper disable once UnusedTypeParameter -internal sealed class RelationshipsInPostRequest +internal sealed class RelationshipsInUpdateResourceRequest where TResource : IIdentifiable; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs index 762b7b4344..919dccfbc3 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs @@ -18,12 +18,12 @@ internal sealed class JsonApiOperationIdSelector private const string SecondaryOperationIdTemplate = $"{ResourceOperationIdTemplate} [RelationshipName]"; private const string RelationshipOperationIdTemplate = $"{SecondaryOperationIdTemplate} Relationship"; - private static readonly IDictionary DocumentOpenTypeToOperationIdTemplateMap = new Dictionary + private static readonly IDictionary DocumentSchemaTypeToOperationIdTemplateMap = new Dictionary { [typeof(ResourceCollectionResponseDocument<>)] = ResourceCollectionOperationIdTemplate, [typeof(PrimaryResourceResponseDocument<>)] = ResourceOperationIdTemplate, - [typeof(ResourcePostRequestDocument<>)] = ResourceOperationIdTemplate, - [typeof(ResourcePatchRequestDocument<>)] = ResourceOperationIdTemplate, + [typeof(CreateResourceRequestDocument<>)] = ResourceOperationIdTemplate, + [typeof(UpdateResourceRequestDocument<>)] = ResourceOperationIdTemplate, [typeof(void)] = ResourceOperationIdTemplate, [typeof(SecondaryResourceResponseDocument<>)] = SecondaryOperationIdTemplate, [typeof(NullableSecondaryResourceResponseDocument<>)] = SecondaryOperationIdTemplate, @@ -68,7 +68,7 @@ private static string GetTemplate(ApiDescription endpoint) { Type requestDocumentType = GetDocumentType(endpoint); - if (!DocumentOpenTypeToOperationIdTemplateMap.TryGetValue(requestDocumentType, out string? template)) + if (!DocumentSchemaTypeToOperationIdTemplateMap.TryGetValue(requestDocumentType, out string? template)) { throw new UnreachableCodeException(); } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiRoutingTemplate.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiRoutingTemplate.cs index 73d5c5eaed..28ef680bbd 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiRoutingTemplate.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiRoutingTemplate.cs @@ -4,9 +4,9 @@ namespace JsonApiDotNetCore.OpenApi; internal static class JsonApiRoutingTemplate { - public const string RelationshipNameUrlPlaceholder = "{" + JsonApiPathParameter.RelationshipName + "}"; + public const string RelationshipNameRoutePlaceholder = "{" + JsonApiPathParameter.RelationshipName + "}"; public const string RelationshipsPart = "relationships"; public const string PrimaryEndpoint = "{id}"; - public const string SecondaryEndpoint = "{id}/" + RelationshipNameUrlPlaceholder; - public const string RelationshipEndpoint = "{id}/" + RelationshipsPart + "/" + RelationshipNameUrlPlaceholder; + public const string SecondaryEndpoint = "{id}/" + RelationshipNameRoutePlaceholder; + public const string RelationshipEndpoint = "{id}/" + RelationshipsPart + "/" + RelationshipNameRoutePlaceholder; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs index 308357b2f3..029372c551 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs @@ -13,14 +13,14 @@ internal sealed class JsonApiSchemaIdSelector private static readonly IDictionary TypeToSchemaTemplateMap = new Dictionary { - [typeof(ResourcePostRequestDocument<>)] = "[ResourceName] Post Request Document", - [typeof(ResourcePatchRequestDocument<>)] = "[ResourceName] Patch Request Document", - [typeof(ResourceDataInPostRequest<>)] = "[ResourceName] Data In Post Request", - [typeof(AttributesInPostRequest<>)] = "[ResourceName] Attributes In Post Request", - [typeof(RelationshipsInPostRequest<>)] = "[ResourceName] Relationships In Post Request", - [typeof(ResourceDataInPatchRequest<>)] = "[ResourceName] Data In Patch Request", - [typeof(AttributesInPatchRequest<>)] = "[ResourceName] Attributes In Patch Request", - [typeof(RelationshipsInPatchRequest<>)] = "[ResourceName] Relationships In Patch Request", + [typeof(CreateResourceRequestDocument<>)] = "Create [ResourceName] Request Document", + [typeof(UpdateResourceRequestDocument<>)] = "Update [ResourceName] Request Document", + [typeof(DataInCreateResourceRequest<>)] = "Data In Create [ResourceName] Request", + [typeof(AttributesInCreateResourceRequest<>)] = "Attributes In Create [ResourceName] Request", + [typeof(RelationshipsInCreateResourceRequest<>)] = "Relationships In Create [ResourceName] Request", + [typeof(DataInUpdateResourceRequest<>)] = "Data In Update [ResourceName] Request", + [typeof(AttributesInUpdateResourceRequest<>)] = "Attributes In Update [ResourceName] Request", + [typeof(RelationshipsInUpdateResourceRequest<>)] = "Relationships In Update [ResourceName] Request", [typeof(ToOneRelationshipInRequest<>)] = "To One [ResourceName] In Request", [typeof(NullableToOneRelationshipInRequest<>)] = "Nullable To One [ResourceName] In Request", [typeof(ToManyRelationshipInRequest<>)] = "To Many [ResourceName] In Request", diff --git a/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs index 2c33907f54..dfbad968b3 100644 --- a/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs @@ -105,11 +105,11 @@ private static bool IsEndpointAvailable(JsonApiEndpoint endpoint, ResourceType r JsonApiEndpoint.GetSingle => availableEndpoints.HasFlag(JsonApiEndpoints.GetSingle), JsonApiEndpoint.GetSecondary => availableEndpoints.HasFlag(JsonApiEndpoints.GetSecondary), JsonApiEndpoint.GetRelationship => availableEndpoints.HasFlag(JsonApiEndpoints.GetRelationship), - JsonApiEndpoint.Post => availableEndpoints.HasFlag(JsonApiEndpoints.Post), + JsonApiEndpoint.PostResource => availableEndpoints.HasFlag(JsonApiEndpoints.Post), JsonApiEndpoint.PostRelationship => availableEndpoints.HasFlag(JsonApiEndpoints.PostRelationship), - JsonApiEndpoint.Patch => availableEndpoints.HasFlag(JsonApiEndpoints.Patch), + JsonApiEndpoint.PatchResource => availableEndpoints.HasFlag(JsonApiEndpoints.Patch), JsonApiEndpoint.PatchRelationship => availableEndpoints.HasFlag(JsonApiEndpoints.PatchRelationship), - JsonApiEndpoint.Delete => availableEndpoints.HasFlag(JsonApiEndpoints.Delete), + JsonApiEndpoint.DeleteResource => availableEndpoints.HasFlag(JsonApiEndpoints.Delete), JsonApiEndpoint.DeleteRelationship => availableEndpoints.HasFlag(JsonApiEndpoints.DeleteRelationship), _ => throw new UnreachableCodeException() }; @@ -152,17 +152,17 @@ private static IEnumerable GetSuccessStatusCodesForEndpoint(Json HttpStatusCode.OK, HttpStatusCode.NotModified ], - JsonApiEndpoint.Post => + JsonApiEndpoint.PostResource => [ HttpStatusCode.Created, HttpStatusCode.NoContent ], - JsonApiEndpoint.Patch => + JsonApiEndpoint.PatchResource => [ HttpStatusCode.OK, HttpStatusCode.NoContent ], - JsonApiEndpoint.Delete or JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship => + JsonApiEndpoint.DeleteResource or JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship => [ HttpStatusCode.NoContent ], @@ -182,7 +182,7 @@ private IEnumerable GetErrorStatusCodesForEndpoint(JsonApiEndpoi HttpStatusCode.BadRequest, HttpStatusCode.NotFound ], - JsonApiEndpoint.Post when clientIdGeneration == ClientIdGenerationMode.Forbidden => + JsonApiEndpoint.PostResource when clientIdGeneration == ClientIdGenerationMode.Forbidden => [ HttpStatusCode.BadRequest, HttpStatusCode.Forbidden, @@ -190,21 +190,21 @@ private IEnumerable GetErrorStatusCodesForEndpoint(JsonApiEndpoi HttpStatusCode.Conflict, HttpStatusCode.UnprocessableEntity ], - JsonApiEndpoint.Post => + JsonApiEndpoint.PostResource => [ HttpStatusCode.BadRequest, HttpStatusCode.NotFound, HttpStatusCode.Conflict, HttpStatusCode.UnprocessableEntity ], - JsonApiEndpoint.Patch => + JsonApiEndpoint.PatchResource => [ HttpStatusCode.BadRequest, HttpStatusCode.NotFound, HttpStatusCode.Conflict, HttpStatusCode.UnprocessableEntity ], - JsonApiEndpoint.Delete => [HttpStatusCode.NotFound], + JsonApiEndpoint.DeleteResource => [HttpStatusCode.NotFound], JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship => new[] { HttpStatusCode.BadRequest, @@ -225,7 +225,7 @@ private static void SetRequestMetadata(ActionModel action, JsonApiEndpoint endpo private static bool RequiresRequestBody(JsonApiEndpoint endpoint) { - return endpoint is JsonApiEndpoint.Post or JsonApiEndpoint.Patch or JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or - JsonApiEndpoint.DeleteRelationship; + return endpoint is JsonApiEndpoint.PostResource or JsonApiEndpoint.PatchResource or JsonApiEndpoint.PostRelationship or + JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship; } } diff --git a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs index 3ca7f7d623..8894d68600 100644 --- a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs @@ -4,6 +4,29 @@ namespace JsonApiDotNetCore.OpenApi; internal static class OpenApiSchemaExtensions { + public static void ReorderProperties(this OpenApiSchema fullSchema, IEnumerable propertyNamesInOrder) + { + ArgumentGuard.NotNull(fullSchema); + ArgumentGuard.NotNull(propertyNamesInOrder); + + var propertiesInOrder = new Dictionary(); + + foreach (string propertyName in propertyNamesInOrder) + { + if (fullSchema.Properties.TryGetValue(propertyName, out OpenApiSchema? schema)) + { + propertiesInOrder.Add(propertyName, schema); + } + } + + if (fullSchema.Properties.Count != propertiesInOrder.Count) + { + throw new UnreachableCodeException(); + } + + fullSchema.Properties = propertiesInOrder; + } + public static OpenApiSchema UnwrapExtendedReferenceSchema(this OpenApiSchema source) { ArgumentGuard.NotNull(source); diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs index 27282938cf..6faf472e9e 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs @@ -8,6 +8,18 @@ namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; internal sealed class ResourceDataSchemaGenerator { +#if NET6_0 + private static readonly string[] ResourceDataPropertyNamesInOrder = + [ + JsonApiPropertyName.Type, + JsonApiPropertyName.Id, + JsonApiPropertyName.Attributes, + JsonApiPropertyName.Relationships, + JsonApiPropertyName.Links, + JsonApiPropertyName.Meta + ]; +#endif + private readonly SchemaGenerator _defaultSchemaGenerator; private readonly ResourceTypeSchemaGenerator _resourceTypeSchemaGenerator; private readonly ResourceIdentifierSchemaGenerator _resourceIdentifierSchemaGenerator; @@ -68,7 +80,7 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo if (effectiveFullSchemaForResourceData == fullSchemaForResourceData) { - RemoveResourceIdIfPostResource(resourceTypeInfo, fullSchemaForResourceData); + AdaptResourceIdentity(resourceTypeInfo, fullSchemaForResourceData); SetResourceType(fullSchemaForResourceData, resourceTypeInfo.ResourceType, schemaRepository); } @@ -81,12 +93,16 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo effectiveFullSchemaForResourceData.SetValuesInMetaToNullable(); +#if NET6_0 + effectiveFullSchemaForResourceData.ReorderProperties(ResourceDataPropertyNamesInOrder); +#endif + return referenceSchemaForResourceData; } - private void RemoveResourceIdIfPostResource(ResourceTypeInfo resourceTypeInfo, OpenApiSchema fullSchemaForResourceData) + private void AdaptResourceIdentity(ResourceTypeInfo resourceTypeInfo, OpenApiSchema fullSchemaForResourceData) { - if (resourceTypeInfo.ResourceDataOpenType == typeof(ResourceDataInPostRequest<>)) + if (resourceTypeInfo.ResourceDataOpenType == typeof(DataInCreateResourceRequest<>)) { ClientIdGenerationMode clientIdGeneration = resourceTypeInfo.ResourceType.ClientIdGeneration ?? _options.ClientIdGeneration; diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs index 284d88c78f..3264f62394 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs @@ -91,8 +91,8 @@ public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, Schema private static AttrCapabilities GetRequiredCapabilityForAttributes(Type resourceDataOpenType) { return resourceDataOpenType == typeof(ResourceDataInResponse<>) ? AttrCapabilities.AllowView : - resourceDataOpenType == typeof(ResourceDataInPostRequest<>) ? AttrCapabilities.AllowCreate : - resourceDataOpenType == typeof(ResourceDataInPatchRequest<>) ? AttrCapabilities.AllowChange : throw new UnreachableCodeException(); + resourceDataOpenType == typeof(DataInCreateResourceRequest<>) ? AttrCapabilities.AllowCreate : + resourceDataOpenType == typeof(DataInUpdateResourceRequest<>) ? AttrCapabilities.AllowChange : throw new UnreachableCodeException(); } private void EnsureAttributeSchemaIsExposed(OpenApiSchema attributeReferenceSchema, AttrAttribute attribute, SchemaRepository schemaRepository) @@ -127,8 +127,8 @@ private Type GetRepresentedTypeForAttributeSchema(AttrAttribute attribute) private bool IsFieldRequired(ResourceFieldAttribute field) { - bool isPostRequestSchemaType = _resourceTypeInfo.ResourceDataOpenType == typeof(ResourceDataInPostRequest<>); - return isPostRequestSchemaType && _resourceFieldValidationMetadataProvider.IsRequired(field); + bool isCreateResourceSchemaType = _resourceTypeInfo.ResourceDataOpenType == typeof(DataInCreateResourceRequest<>); + return isCreateResourceSchemaType && _resourceFieldValidationMetadataProvider.IsRequired(field); } public void SetMembersOfRelationships(OpenApiSchema fullSchemaForRelationships, SchemaRepository schemaRepository) diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs index 7783c71f0c..270a9057a1 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs @@ -38,12 +38,12 @@ public async Task Cannot_create_resource_without_ID_when_supplying_ID_is_require using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new PlayerPostRequestDocument + var requestBody = new CreatePlayerRequestDocument { - Data = new PlayerDataInPostRequest + Data = new DataInCreatePlayerRequest { Type = PlayerResourceType.Players, - Attributes = new PlayerAttributesInPostRequest + Attributes = new AttributesInCreatePlayerRequest { UserName = newPlayer.UserName } @@ -77,13 +77,13 @@ public async Task Can_create_resource_with_ID_when_supplying_ID_is_required() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new PlayerPostRequestDocument + var requestBody = new CreatePlayerRequestDocument { - Data = new PlayerDataInPostRequest + Data = new DataInCreatePlayerRequest { Type = PlayerResourceType.Players, Id = newPlayer.StringId, - Attributes = new PlayerAttributesInPostRequest + Attributes = new AttributesInCreatePlayerRequest { UserName = newPlayer.UserName } @@ -113,12 +113,12 @@ public async Task Can_create_resource_without_ID_when_supplying_ID_is_allowed() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { Type = GameResourceType.Games, - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = newGame.Title, PurchasePrice = (double)newGame.PurchasePrice @@ -155,13 +155,13 @@ public async Task Can_create_resource_with_ID_when_supplying_ID_is_allowed() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { Type = GameResourceType.Games, Id = newGame.StringId, - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = newGame.Title, PurchasePrice = (double)newGame.PurchasePrice @@ -199,13 +199,13 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { Type = GameResourceType.Games, Id = existingGame.StringId, - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = existingGame.Title, PurchasePrice = (double)existingGame.PurchasePrice @@ -237,12 +237,12 @@ public async Task Can_create_resource_without_ID_when_supplying_ID_is_forbidden( using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ClientIdGenerationModesClient apiClient = new(requestAdapter); - var requestBody = new PlayerGroupPostRequestDocument + var requestBody = new CreatePlayerGroupRequestDocument { - Data = new PlayerGroupDataInPostRequest + Data = new DataInCreatePlayerGroupRequest { Type = PlayerGroupResourceType.PlayerGroups, - Attributes = new PlayerGroupAttributesInPostRequest + Attributes = new AttributesInCreatePlayerGroupRequest { Name = newPlayerGroup.Name } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs index 6325ad2cce..f62ef77881 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs @@ -43,11 +43,11 @@ public GamesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(GamePostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateGameRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(GamePostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateGameRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -69,11 +69,11 @@ public async Task PostAsync(GamePostRequestDocument /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(GamePostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateGameRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(GamePostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateGameRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs index 57c87c2260..917d048963 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class GameAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInCreateGameRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -32,21 +32,21 @@ public string Title { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public GameAttributesInPostRequest() + public AttributesInCreateGameRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GameAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameAttributesInPostRequest(); + return new AttributesInCreateGameRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs similarity index 82% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs index 103ba6bdf2..4d829b23c5 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerGroupAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerGroupAttributesInPostRequest() + public AttributesInCreatePlayerGroupRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupAttributesInPostRequest(); + return new AttributesInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs index b63830c999..c228d13196 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public string UserName { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerAttributesInPostRequest() + public AttributesInCreatePlayerRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerAttributesInPostRequest(); + return new AttributesInCreatePlayerRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs similarity index 73% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs index 97f7cb5f16..74fd5c8ff2 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerPostRequestDocument : IBackedModel, IParsable + public class CreateGameRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class PlayerPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateGameRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PlayerDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateGameRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerPostRequestDocument() + public CreateGameRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateGameRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerPostRequestDocument(); + return new CreateGameRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PlayerDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateGameRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs index 5b6a7bf143..103812b4b3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairPostRequestDocument : IBackedModel, IParsable + public class CreatePlayerGroupRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class NameValuePairPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePlayerGroupRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NameValuePairDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePlayerGroupRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairPostRequestDocument() + public CreatePlayerGroupRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreatePlayerGroupRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairPostRequestDocument(); + return new CreatePlayerGroupRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NameValuePairDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs index c9c0d57a8d..b33a707ce6 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryPatchRequestDocument : IBackedModel, IParsable + public class CreatePlayerRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class CountryPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePlayerRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public CountryDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreatePlayerRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryPatchRequestDocument() + public CreatePlayerRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreatePlayerRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryPatchRequestDocument(); + return new CreatePlayerRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(CountryDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs similarity index 76% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs index 69e67e09d8..8a649fdf47 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class GameDataInPostRequest : IBackedModel, IParsable + public class DataInCreateGameRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public GameAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateGameRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public GameAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateGameRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -46,21 +46,21 @@ public GameResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public GameDataInPostRequest() + public DataInCreateGameRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GameDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameDataInPostRequest(); + return new DataInCreateGameRequest(); } /// /// The deserialization information for the current model @@ -70,7 +70,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(GameAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateGameRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; @@ -82,7 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); writer.WriteEnumValue("type", Type); } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs similarity index 64% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs index 5bde2f6157..4c00107822 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerGroupDataInPostRequest : IBackedModel, IParsable + public class DataInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePlayerGroupRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PlayerGroupAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePlayerGroupRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public PlayerGroupAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePlayerGroupRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PlayerGroupRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePlayerGroupRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public PlayerGroupResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerGroupDataInPostRequest() + public DataInCreatePlayerGroupRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupDataInPostRequest(); + return new DataInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerGroupAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerGroupRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs index 16a03eac22..271f6f8207 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerDataInPostRequest : IBackedModel, IParsable + public class DataInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePlayerRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PlayerAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreatePlayerRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePlayerRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PlayerRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreatePlayerRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public PlayerResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerDataInPostRequest() + public DataInCreatePlayerRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerDataInPostRequest(); + return new DataInCreatePlayerRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePostRequestDocument.cs deleted file mode 100644 index 534b92245f..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePostRequestDocument.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class GamePostRequestDocument : IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// The data property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public GameDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#nullable restore -#else - public GameDataInPostRequest Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public GamePostRequestDocument() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static GamePostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GamePostRequestDocument(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"data", n => { Data = n.GetObjectValue(GameDataInPostRequest.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs similarity index 82% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs index 842e1157c2..ad74308c1c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerGroupRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToManyPlayerInRequest Players { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerGroupRelationshipsInPostRequest() + public RelationshipsInCreatePlayerGroupRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupRelationshipsInPostRequest(); + return new RelationshipsInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs similarity index 87% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs index c6e0d4716e..26bb995299 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public ToManyGameInRequest OwnedGames { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerRelationshipsInPostRequest() + public RelationshipsInCreatePlayerRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerRelationshipsInPostRequest(); + return new RelationshipsInCreatePlayerRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs index b683f1ea7a..07d887ef9c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs @@ -44,11 +44,11 @@ public PlayerGroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(PlayerGroupPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(PlayerGroupPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -71,11 +71,11 @@ public async Task PostAsync(PlayerGroupPostR /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(PlayerGroupPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(PlayerGroupPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs index 879996b45f..3f54591d5b 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs @@ -43,11 +43,11 @@ public PlayersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : ba /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(PlayerPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePlayerRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(PlayerPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreatePlayerRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -69,11 +69,11 @@ public async Task PostAsync(PlayerPostRequestDocu /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(PlayerPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePlayerRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(PlayerPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreatePlayerRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Headers/ETagTests.cs b/test/OpenApiKiotaEndToEndTests/Headers/ETagTests.cs index f2d3c9a841..e9da77d95a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/ETagTests.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/ETagTests.cs @@ -135,12 +135,12 @@ public async Task Returns_no_ETag_for_POST_request() InspectResponseHeaders = true }; - var requestBody = new CountryPostRequestDocument + var requestBody = new CreateCountryRequestDocument { - Data = new CountryDataInPostRequest + Data = new DataInCreateCountryRequest { Type = CountryResourceType.Countries, - Attributes = new CountryAttributesInPostRequest + Attributes = new AttributesInCreateCountryRequest { Name = newCountry.Name, Population = newCountry.Population diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs index 58c73eb146..853db58113 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CountryPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CountryPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CountryPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateCountryRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CountryPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateCountryRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs index d1b62f68f7..048bbd2f1b 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs @@ -119,11 +119,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(CountryPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(CountryPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -201,11 +201,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(CountryPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateCountryRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(CountryPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateCountryRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs index 2ef4aa70df..5afaf15a90 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -32,21 +32,21 @@ public long? Population { set { BackingStore?.Set("population", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryAttributesInPostRequest() + public AttributesInCreateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryAttributesInPostRequest(); + return new AttributesInCreateCountryRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs index d73f41a14e..54889cf6c7 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -32,21 +32,21 @@ public long? Population { set { BackingStore?.Set("population", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryAttributesInPatchRequest() + public AttributesInUpdateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryAttributesInPatchRequest(); + return new AttributesInUpdateCountryRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPostRequestDocument.cs deleted file mode 100644 index 3f0ced1ee0..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPostRequestDocument.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class CountryPostRequestDocument : IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// The data property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public CountryDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#nullable restore -#else - public CountryDataInPostRequest Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public CountryPostRequestDocument() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static CountryPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryPostRequestDocument(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"data", n => { Data = n.GetObjectValue(CountryDataInPostRequest.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs similarity index 71% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs index 7f760c7c49..a66bbaec85 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemPatchRequestDocument : IBackedModel, IParsable + public class CreateCountryRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class TodoItemPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateCountryRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TodoItemDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateCountryRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemPatchRequestDocument() + public CreateCountryRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemPatchRequestDocument(); + return new CreateCountryRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TodoItemDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateCountryRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs similarity index 65% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs index 0d0d22a76b..67686df5b0 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryDataInPostRequest : IBackedModel, IParsable + public class DataInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateCountryRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public CountryAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateCountryRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public CountryAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateCountryRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public CountryRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateCountryRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public CountryResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryDataInPostRequest() + public DataInCreateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryDataInPostRequest(); + return new DataInCreateCountryRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(CountryAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(CountryRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateCountryRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateCountryRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs index b19d909a1e..e050d070dc 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateCountryRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public CountryAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateCountryRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateCountryRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public CountryRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateCountryRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public CountryResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryDataInPatchRequest() + public DataInUpdateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryDataInPatchRequest(); + return new DataInUpdateCountryRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(CountryAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(CountryRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs index 08501b6eb6..05f0d50abe 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToManyLanguageInRequest Languages { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryRelationshipsInPatchRequest() + public RelationshipsInCreateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryRelationshipsInPatchRequest(); + return new RelationshipsInCreateCountryRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs index b43c98a9e3..73ceccabc4 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class CountryRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToManyLanguageInRequest Languages { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public CountryRelationshipsInPostRequest() + public RelationshipsInUpdateCountryRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryRelationshipsInPostRequest(); + return new RelationshipsInUpdateCountryRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs index 11c9ba598e..32382b47e0 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportPostRequestDocument : IBackedModel, IParsable + public class UpdateCountryRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class TransportPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateCountryRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TransportDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateCountryRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportPostRequestDocument() + public UpdateCountryRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportPostRequestDocument(); + return new UpdateCountryRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TransportDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/HeaderTests.cs b/test/OpenApiKiotaEndToEndTests/Headers/HeaderTests.cs index 41d4b31ca6..a0fed72136 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/HeaderTests.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/HeaderTests.cs @@ -40,12 +40,12 @@ public async Task Returns_Location_for_post_resource_request() InspectResponseHeaders = true }; - var requestBody = new CountryPostRequestDocument + var requestBody = new CreateCountryRequestDocument { - Data = new CountryDataInPostRequest + Data = new DataInCreateCountryRequest { Type = CountryResourceType.Countries, - Attributes = new CountryAttributesInPostRequest + Attributes = new AttributesInCreateCountryRequest { Name = newCountry.Name, Population = newCountry.Population diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs index a6273098af..9bfffb8ab4 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(AccommodationPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(AccommodationPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(AccommodationPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateAccommodationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(AccommodationPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateAccommodationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs index c8d2f82e48..755d441541 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs @@ -107,11 +107,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(AccommodationPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(AccommodationPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -189,11 +189,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(AccommodationPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(AccommodationPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateAccommodationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs index 7d559eac6d..464b420f01 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ExcursionPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ExcursionPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ExcursionPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateExcursionRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ExcursionPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateExcursionRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs index 9685707b05..3b662c9a08 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs @@ -107,11 +107,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ExcursionPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ExcursionPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -189,11 +189,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ExcursionPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateExcursionRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ExcursionPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateExcursionRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs similarity index 81% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs index 16174076de..5e3f97b344 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The address property @@ -27,21 +27,21 @@ public string Address { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationAttributesInPatchRequest() + public AttributesInCreateAccommodationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationAttributesInPatchRequest(); + return new AttributesInCreateAccommodationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs index 077c83cd0d..5f928fcc54 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -32,21 +32,21 @@ public DateTimeOffset? OccursAt { set { BackingStore?.Set("occursAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionAttributesInPatchRequest() + public AttributesInCreateExcursionRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionAttributesInPatchRequest(); + return new AttributesInCreateExcursionRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs index d4aa03f740..e4cb88abb1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInCreateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -23,21 +23,21 @@ public int? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportAttributesInPostRequest() + public AttributesInCreateTransportRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportAttributesInPostRequest(); + return new AttributesInCreateTransportRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs index e5fc8dacdf..60e866e372 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -23,21 +23,21 @@ public DateTimeOffset? StartsAt { set { BackingStore?.Set("startsAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationAttributesInPatchRequest() + public AttributesInCreateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationAttributesInPatchRequest(); + return new AttributesInCreateVacationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs similarity index 81% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs index c370ca0046..44c0d6a9bb 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The address property @@ -27,21 +27,21 @@ public string Address { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationAttributesInPostRequest() + public AttributesInUpdateAccommodationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationAttributesInPostRequest(); + return new AttributesInUpdateAccommodationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs index c77396bb33..a1181d0448 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -32,21 +32,21 @@ public DateTimeOffset? OccursAt { set { BackingStore?.Set("occursAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionAttributesInPostRequest() + public AttributesInUpdateExcursionRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionAttributesInPostRequest(); + return new AttributesInUpdateExcursionRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs index 7f4ea6e1ab..331cacb486 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInUpdateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -23,21 +23,21 @@ public int? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportAttributesInPatchRequest() + public AttributesInUpdateTransportRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportAttributesInPatchRequest(); + return new AttributesInUpdateTransportRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs similarity index 83% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs index abb13f8895..eeb62a0f96 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -23,21 +23,21 @@ public DateTimeOffset? StartsAt { set { BackingStore?.Set("startsAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationAttributesInPostRequest() + public AttributesInUpdateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationAttributesInPostRequest(); + return new AttributesInUpdateVacationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs similarity index 66% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs index 732384b4f0..e465d5afc2 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationPatchRequestDocument : IBackedModel, IParsable + public class CreateAccommodationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class AccommodationPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateAccommodationRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public AccommodationDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateAccommodationRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationPatchRequestDocument() + public CreateAccommodationRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationPatchRequestDocument(); + return new CreateAccommodationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(AccommodationDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs index 6020074de2..00ac5e8202 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerGroupPostRequestDocument : IBackedModel, IParsable + public class CreateExcursionRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class PlayerGroupPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateExcursionRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PlayerGroupDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateExcursionRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerGroupPostRequestDocument() + public CreateExcursionRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupPostRequestDocument(); + return new CreateExcursionRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PlayerGroupDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs similarity index 67% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs index 720a6ecc1f..017f73e400 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionPostRequestDocument : IBackedModel, IParsable + public class CreateTransportRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class ExcursionPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTransportRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public ExcursionDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateTransportRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionPostRequestDocument() + public CreateTransportRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionPostRequestDocument(); + return new CreateTransportRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(ExcursionDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateTransportRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs similarity index 73% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs index fec2e8fc5f..0b71cf93cd 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportPatchRequestDocument : IBackedModel, IParsable + public class CreateVacationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class TransportPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateVacationRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TransportDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateVacationRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportPatchRequestDocument() + public CreateVacationRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportPatchRequestDocument(); + return new CreateVacationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TransportDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateVacationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs similarity index 70% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs index 540e0f9b21..7d381a8a05 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationDataInPostRequest : IBackedModel, IParsable + public class DataInCreateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateAccommodationRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AccommodationAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateAccommodationRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -32,21 +32,21 @@ public AccommodationResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationDataInPostRequest() + public DataInCreateAccommodationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationDataInPostRequest(); + return new DataInCreateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -56,7 +56,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AccommodationAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -67,7 +67,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs index f2a305df09..dbbd0a2cd9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionDataInPostRequest : IBackedModel, IParsable + public class DataInCreateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateExcursionRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public ExcursionAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateExcursionRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -32,21 +32,21 @@ public ExcursionResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionDataInPostRequest() + public DataInCreateExcursionRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionDataInPostRequest(); + return new DataInCreateExcursionRequest(); } /// /// The deserialization information for the current model @@ -56,7 +56,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(ExcursionAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -67,7 +67,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs similarity index 71% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs index 75371d32bc..039ff252a9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportDataInPostRequest : IBackedModel, IParsable + public class DataInCreateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTransportRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TransportAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateTransportRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -32,21 +32,21 @@ public TransportResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportDataInPostRequest() + public DataInCreateTransportRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportDataInPostRequest(); + return new DataInCreateTransportRequest(); } /// /// The deserialization information for the current model @@ -56,7 +56,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TransportAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTransportRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -67,7 +67,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs similarity index 64% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs index 7ee8ac0b7e..75ec3e59c6 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationDataInPostRequest : IBackedModel, IParsable + public class DataInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateVacationRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public VacationAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateVacationRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public VacationAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateVacationRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public VacationRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateVacationRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public VacationResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationDataInPostRequest() + public DataInCreateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationDataInPostRequest(); + return new DataInCreateVacationRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(VacationAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(VacationRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateVacationRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateVacationRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs similarity index 74% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs index 810970951f..4f02d6a594 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateAccommodationRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AccommodationAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateAccommodationRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -46,21 +46,21 @@ public AccommodationResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationDataInPatchRequest() + public DataInUpdateAccommodationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationDataInPatchRequest(); + return new DataInUpdateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -70,7 +70,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AccommodationAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; @@ -82,7 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); writer.WriteEnumValue("type", Type); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs similarity index 75% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs index 9fdedfb37b..92948752f1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateExcursionRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public ExcursionAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateExcursionRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -46,21 +46,21 @@ public ExcursionResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionDataInPatchRequest() + public DataInUpdateExcursionRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionDataInPatchRequest(); + return new DataInUpdateExcursionRequest(); } /// /// The deserialization information for the current model @@ -70,7 +70,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(ExcursionAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; @@ -82,7 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); writer.WriteEnumValue("type", Type); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs similarity index 75% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs index 9ef02b3874..abfc6f029c 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTransportRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TransportAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateTransportRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -46,21 +46,21 @@ public TransportResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportDataInPatchRequest() + public DataInUpdateTransportRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportDataInPatchRequest(); + return new DataInUpdateTransportRequest(); } /// /// The deserialization information for the current model @@ -70,7 +70,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(TransportAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; @@ -82,7 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); writer.WriteEnumValue("type", Type); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs similarity index 68% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs index 5ebe1168ed..a9e9fa0e5b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateVacationRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public VacationAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateVacationRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateVacationRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public VacationRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateVacationRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public VacationResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationDataInPatchRequest() + public DataInUpdateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationDataInPatchRequest(); + return new DataInUpdateVacationRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(VacationAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(VacationRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs index 7d87d6f504..28053857b9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The accommodation property @@ -55,21 +55,21 @@ public NullableToOneTransportInRequest Transport { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationRelationshipsInPatchRequest() + public RelationshipsInCreateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationRelationshipsInPatchRequest(); + return new RelationshipsInCreateVacationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs index 54770452b0..54e755297c 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class VacationRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The accommodation property @@ -55,21 +55,21 @@ public NullableToOneTransportInRequest Transport { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public VacationRelationshipsInPostRequest() + public RelationshipsInUpdateVacationRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationRelationshipsInPostRequest(); + return new RelationshipsInUpdateVacationRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs similarity index 66% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs index 45efd49158..4d34a5c4bb 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationPostRequestDocument : IBackedModel, IParsable + public class UpdateAccommodationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class AccommodationPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateAccommodationRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public AccommodationDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateAccommodationRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationPostRequestDocument() + public UpdateAccommodationRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationPostRequestDocument(); + return new UpdateAccommodationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(AccommodationDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs new file mode 100644 index 0000000000..5ff5750353 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { + #pragma warning disable CS1591 + public class UpdateExcursionRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DataInUpdateExcursionRequest? Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public DataInUpdateExcursionRequest Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateExcursionRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpdateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateExcursionRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"data", n => { Data = n.GetObjectValue(DataInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs new file mode 100644 index 0000000000..de147e637d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { + #pragma warning disable CS1591 + public class UpdateTransportRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DataInUpdateTransportRequest? Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public DataInUpdateTransportRequest Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateTransportRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpdateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateTransportRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"data", n => { Data = n.GetObjectValue(DataInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs similarity index 73% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs index 9a6bd4600e..d55c3b624c 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionPatchRequestDocument : IBackedModel, IParsable + public class UpdateVacationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class ExcursionPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateVacationRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public ExcursionDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateVacationRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionPatchRequestDocument() + public UpdateVacationRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionPatchRequestDocument(); + return new UpdateVacationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(ExcursionDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPatchRequestDocument.cs deleted file mode 100644 index 6da6d5ca00..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPatchRequestDocument.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class VacationPatchRequestDocument : IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// The data property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public VacationDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#nullable restore -#else - public VacationDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public VacationPatchRequestDocument() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static VacationPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationPatchRequestDocument(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"data", n => { Data = n.GetObjectValue(VacationDataInPatchRequest.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs index 1ad25b3208..c72b293622 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs @@ -107,11 +107,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(TransportPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(TransportPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -189,11 +189,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(TransportPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTransportRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(TransportPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateTransportRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs index 33f1a6a764..af79b5ec0a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(TransportPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(TransportPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(TransportPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTransportRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(TransportPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateTransportRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs index 47ee929035..ff7fc9165f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs @@ -131,11 +131,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(VacationPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(VacationPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -213,11 +213,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(VacationPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateVacationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(VacationPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateVacationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs index 17f204c541..096c3da80d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(VacationPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(VacationPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(VacationPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateVacationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(VacationPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateVacationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs similarity index 95% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs index 75688fb5f1..7c5fa04bd3 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs @@ -8,7 +8,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The age property @@ -221,21 +221,21 @@ public Time? ValidatedAtTime { set { BackingStore?.Set("validatedAtTime", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountAttributesInPatchRequest() + public AttributesInCreateSocialMediaAccountRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountAttributesInPatchRequest(); + return new AttributesInCreateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs similarity index 95% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs index f904b499d0..4dac21ff93 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs @@ -8,7 +8,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The age property @@ -221,21 +221,21 @@ public Time? ValidatedAtTime { set { BackingStore?.Set("validatedAtTime", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountAttributesInPostRequest() + public AttributesInUpdateSocialMediaAccountRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountAttributesInPostRequest(); + return new AttributesInUpdateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs similarity index 64% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs index 4dbdff98e6..733f871101 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountPatchRequestDocument : IBackedModel, IParsable + public class CreateSocialMediaAccountRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class SocialMediaAccountPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateSocialMediaAccountRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public SocialMediaAccountDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateSocialMediaAccountRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountPatchRequestDocument() + public CreateSocialMediaAccountRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountPatchRequestDocument(); + return new CreateSocialMediaAccountRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(SocialMediaAccountDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs index a6cf4814d5..df1855bd22 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountDataInPostRequest : IBackedModel, IParsable + public class DataInCreateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateSocialMediaAccountRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public SocialMediaAccountAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateSocialMediaAccountRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -32,21 +32,21 @@ public SocialMediaAccountResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountDataInPostRequest() + public DataInCreateSocialMediaAccountRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountDataInPostRequest(); + return new DataInCreateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -56,7 +56,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(SocialMediaAccountAttributesInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -67,7 +67,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs similarity index 73% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs index ab2367b343..22389eda3a 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateSocialMediaAccountRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public SocialMediaAccountAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateSocialMediaAccountRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -46,21 +46,21 @@ public SocialMediaAccountResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountDataInPatchRequest() + public DataInUpdateSocialMediaAccountRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountDataInPatchRequest(); + return new DataInUpdateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -70,7 +70,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(SocialMediaAccountAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; @@ -82,7 +82,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); writer.WriteEnumValue("type", Type); } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs new file mode 100644 index 0000000000..7d6a921e71 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { + #pragma warning disable CS1591 + public class UpdateSocialMediaAccountRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DataInUpdateSocialMediaAccountRequest? Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public DataInUpdateSocialMediaAccountRequest Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateSocialMediaAccountRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpdateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateSocialMediaAccountRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"data", n => { Data = n.GetObjectValue(DataInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs index 0f32286f7e..998fb83165 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs @@ -43,11 +43,11 @@ public SocialMediaAccountsItemRequestBuilder(string rawUrl, IRequestAdapter requ /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(SocialMediaAccountPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(SocialMediaAccountPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -69,11 +69,11 @@ public async Task PatchAsync(SocialMe /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(SocialMediaAccountPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(SocialMediaAccountPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs index 57524088f0..37f4db7a30 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs @@ -57,11 +57,11 @@ public SocialMediaAccountsRequestBuilder(string rawUrl, IRequestAdapter requestA /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(SocialMediaAccountPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(SocialMediaAccountPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -84,11 +84,11 @@ public async Task PostAsync(SocialMed /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(SocialMediaAccountPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(SocialMediaAccountPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs index 7727a1b272..35f42a4dff 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs @@ -42,12 +42,12 @@ public async Task Cannot_exceed_length_constraint(string firstName) using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { FirstName = firstName, LastName = newAccount.LastName @@ -80,12 +80,12 @@ public async Task Cannot_exceed_string_length_constraint(string userName) using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, UserName = userName @@ -116,12 +116,12 @@ public async Task Cannot_violate_regular_expression_constraint() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, UserName = "aB1" @@ -152,12 +152,12 @@ public async Task Cannot_use_invalid_credit_card_number() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, CreditCard = "123-456" @@ -188,12 +188,12 @@ public async Task Cannot_use_invalid_email_address() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Email = "abc" @@ -224,12 +224,12 @@ public async Task Cannot_exceed_min_length_constraint() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, // Using -3 instead of -1 to compensate for base64 padding. @@ -263,12 +263,12 @@ public async Task Cannot_exceed_max_length_constraint() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Password = Convert.ToBase64String(Enumerable.Repeat((byte)'X', SocialMediaAccount.MaxPasswordChars + 1).ToArray()) @@ -301,12 +301,12 @@ public async Task Cannot_use_invalid_base64() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Password = "not-a-valid-base64-string" @@ -341,12 +341,12 @@ public async Task Cannot_use_double_outside_of_valid_range(double age) using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Age = age @@ -377,12 +377,12 @@ public async Task Cannot_use_relative_url() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, BackgroundPicture = "relative-url" @@ -415,12 +415,12 @@ public async Task Cannot_exceed_collection_length_constraint(int length) using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Tags = Enumerable.Repeat("-", length).ToList() @@ -451,12 +451,12 @@ public async Task Cannot_use_non_allowed_value() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, CountryCode = "XX" @@ -487,12 +487,12 @@ public async Task Cannot_use_denied_value() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Planet = "pluto" @@ -523,12 +523,12 @@ public async Task Cannot_use_TimeSpan_outside_of_valid_range() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, NextRevalidation = TimeSpan.FromSeconds(1).ToString() @@ -559,12 +559,12 @@ public async Task Can_create_resource_with_valid_properties() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); ModelStateValidationClient apiClient = new(requestAdapter); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { AlternativeId = newAccount.AlternativeId, FirstName = newAccount.FirstName, diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs index 6f0e76c31c..50af4daada 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string Value { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairAttributesInPatchRequest() + public AttributesInCreateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairAttributesInPatchRequest(); + return new AttributesInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs similarity index 86% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs index 0681353d4c..95e7d67199 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeAttributesInPatchRequest() + public AttributesInCreateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeAttributesInPatchRequest(); + return new AttributesInCreateNodeRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs similarity index 84% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs index 8094b801d6..b3cd44f741 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string Value { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairAttributesInPostRequest() + public AttributesInUpdateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairAttributesInPostRequest(); + return new AttributesInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs similarity index 86% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs index b2165b96a5..194641d8db 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -41,21 +41,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeAttributesInPostRequest() + public AttributesInUpdateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeAttributesInPostRequest(); + return new AttributesInUpdateNodeRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs similarity index 66% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs index df85f2ba7c..ecaac721ba 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairPatchRequestDocument : IBackedModel, IParsable + public class CreateNameValuePairRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class NameValuePairPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateNameValuePairRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NameValuePairDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateNameValuePairRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairPatchRequestDocument() + public CreateNameValuePairRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairPatchRequestDocument(); + return new CreateNameValuePairRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NameValuePairDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs similarity index 71% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs index 06c01e8b14..dcc9433def 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonPostRequestDocument : IBackedModel, IParsable + public class CreateNodeRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class PersonPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateNodeRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateNodeRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonPostRequestDocument() + public CreateNodeRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonPostRequestDocument(); + return new CreateNodeRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateNodeRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs similarity index 63% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs index 9315343728..1aa8fead9f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairDataInPostRequest : IBackedModel, IParsable + public class DataInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateNameValuePairRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NameValuePairAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateNameValuePairRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public NameValuePairAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateNameValuePairRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NameValuePairRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateNameValuePairRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public NameValuePairResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairDataInPostRequest() + public DataInCreateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairDataInPostRequest(); + return new DataInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(NameValuePairAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NameValuePairRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs similarity index 66% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs index 976002eee5..0aac0f38c9 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeDataInPostRequest : IBackedModel, IParsable + public class DataInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateNodeRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NodeAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateNodeRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public NodeAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateNodeRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NodeRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateNodeRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public NodeResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeDataInPostRequest() + public DataInCreateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeDataInPostRequest(); + return new DataInCreateNodeRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateNodeRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateNodeRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs similarity index 67% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs index e3d3f7d3c0..e1a58daae4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateNameValuePairRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NameValuePairAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateNameValuePairRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateNameValuePairRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NameValuePairRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateNameValuePairRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public NameValuePairResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairDataInPatchRequest() + public DataInUpdateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairDataInPatchRequest(); + return new DataInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(NameValuePairAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NameValuePairRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs index 08ae248be6..e26a0224e3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateNodeRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NodeAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateNodeRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateNodeRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NodeRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateNodeRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public NodeResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeDataInPatchRequest() + public DataInUpdateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeDataInPatchRequest(); + return new DataInUpdateNodeRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs similarity index 82% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs index 1df0e661b7..94e8dfddf3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToOneNodeInRequest Owner { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairRelationshipsInPatchRequest() + public RelationshipsInCreateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairRelationshipsInPatchRequest(); + return new RelationshipsInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs index 283a2f3619..8af49e0d69 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -55,21 +55,21 @@ public ToManyNameValuePairInRequest Values { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeRelationshipsInPatchRequest() + public RelationshipsInCreateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeRelationshipsInPatchRequest(); + return new RelationshipsInCreateNodeRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs similarity index 82% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs index d81fe84a8b..e5e6896556 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -27,21 +27,21 @@ public ToOneNodeInRequest Owner { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairRelationshipsInPostRequest() + public RelationshipsInUpdateNameValuePairRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairRelationshipsInPostRequest(); + return new RelationshipsInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs index 950aaa47a2..20efe61da6 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -55,21 +55,21 @@ public ToManyNameValuePairInRequest Values { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeRelationshipsInPostRequest() + public RelationshipsInUpdateNodeRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeRelationshipsInPostRequest(); + return new RelationshipsInUpdateNodeRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs new file mode 100644 index 0000000000..d16f55a54c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs @@ -0,0 +1,67 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { + #pragma warning disable CS1591 + public class UpdateNameValuePairRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public DataInUpdateNameValuePairRequest? Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public DataInUpdateNameValuePairRequest Data { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateNameValuePairRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static UpdateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new UpdateNameValuePairRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + {"data", n => { Data = n.GetObjectValue(DataInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs similarity index 68% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs index 3cff4d1e4f..659e0db3e4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodePostRequestDocument : IBackedModel, IParsable + public class UpdateNodeRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class NodePostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateNodeRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateNodeRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodePostRequestDocument() + public UpdateNodeRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodePostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodePostRequestDocument(); + return new UpdateNodeRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs index a607d5a756..b0b10d5a5f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs @@ -119,11 +119,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NameValuePairPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NameValuePairPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -201,11 +201,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NameValuePairPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NameValuePairPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs index f6026575b9..45360a63ed 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(NameValuePairPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(NameValuePairPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(NameValuePairPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(NameValuePairPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateNameValuePairRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs index 9de52f7828..56c05a1947 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs @@ -131,11 +131,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NodePatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NodePatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -213,11 +213,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NodePatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateNodeRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NodePatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateNodeRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs index af17844513..e718b2c305 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs @@ -97,11 +97,11 @@ public async Task HeadAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(NodePostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(NodePostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -161,11 +161,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(NodePostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateNodeRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(NodePostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateNodeRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs index 61f61fc198..ae4eb391fb 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs @@ -44,17 +44,17 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - var requestBody = new WriteOnlyChannelPostRequestDocument + var requestBody = new CreateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPostRequest + Data = new DataInCreateWriteOnlyChannelRequest { Type = WriteOnlyChannelResourceType.WriteOnlyChannels, - Attributes = new WriteOnlyChannelAttributesInPostRequest + Attributes = new AttributesInCreateWriteOnlyChannelRequest { Name = newChannel.Name, IsAdultOnly = newChannel.IsAdultOnly }, - Relationships = new WriteOnlyChannelRelationshipsInPostRequest + Relationships = new RelationshipsInCreateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { @@ -153,7 +153,7 @@ public async Task Cannot_create_resource_for_missing_request_body() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - WriteOnlyChannelPostRequestDocument requestBody = null!; + CreateWriteOnlyChannelRequestDocument requestBody = null!; // Act Func action = async () => _ = await apiClient.WriteOnlyChannels.PostAsync(requestBody); @@ -173,16 +173,16 @@ public async Task Cannot_create_resource_with_unknown_relationship_ID() using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - var requestBody = new WriteOnlyChannelPostRequestDocument + var requestBody = new CreateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPostRequest + Data = new DataInCreateWriteOnlyChannelRequest { Type = WriteOnlyChannelResourceType.WriteOnlyChannels, - Attributes = new WriteOnlyChannelAttributesInPostRequest + Attributes = new AttributesInCreateWriteOnlyChannelRequest { Name = newChannel.Name }, - Relationships = new WriteOnlyChannelRelationshipsInPostRequest + Relationships = new RelationshipsInCreateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs index f12c5cb652..383938062a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelAttributesInPatchRequest : IBackedModel, IParsable + public class AttributesInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -37,21 +37,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelAttributesInPatchRequest() + public AttributesInCreateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelAttributesInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelAttributesInPatchRequest(); + return new AttributesInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs index fb2729d8c3..6db75b3f12 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelAttributesInPostRequest : IBackedModel, IParsable + public class AttributesInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -37,21 +37,21 @@ public string Name { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelAttributesInPostRequest() + public AttributesInUpdateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelAttributesInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static AttributesInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelAttributesInPostRequest(); + return new AttributesInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs similarity index 69% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPostRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs index 91c75791bf..da1924151a 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPostRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs @@ -5,9 +5,9 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class SocialMediaAccountPostRequestDocument : IBackedModel, IParsable + public class CreateWriteOnlyChannelRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class SocialMediaAccountPostRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInCreateWriteOnlyChannelRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public SocialMediaAccountDataInPostRequest Data { - get { return BackingStore?.Get("data"); } + public DataInCreateWriteOnlyChannelRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public SocialMediaAccountPostRequestDocument() + public CreateWriteOnlyChannelRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static CreateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountPostRequestDocument(); + return new CreateWriteOnlyChannelRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(SocialMediaAccountDataInPostRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs similarity index 63% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs index 406001d670..a4d0fd8d18 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelDataInPostRequest : IBackedModel, IParsable + public class DataInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelAttributesInPostRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateWriteOnlyChannelRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public WriteOnlyChannelAttributesInPostRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInCreateWriteOnlyChannelRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,14 +29,14 @@ public WriteOnlyChannelAttributesInPostRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelRelationshipsInPostRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateWriteOnlyChannelRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public WriteOnlyChannelRelationshipsInPostRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInCreateWriteOnlyChannelRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -46,21 +46,21 @@ public WriteOnlyChannelResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelDataInPostRequest() + public DataInCreateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelDataInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelDataInPostRequest(); + return new DataInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -70,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(WriteOnlyChannelAttributesInPostRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(WriteOnlyChannelRelationshipsInPostRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -82,8 +82,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs similarity index 67% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs index 9f666192e6..1b308dee03 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs @@ -7,20 +7,20 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelDataInPatchRequest : IBackedModel, IParsable + public class DataInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelAttributesInPatchRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateWriteOnlyChannelRequest? Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public WriteOnlyChannelAttributesInPatchRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public AttributesInUpdateWriteOnlyChannelRequest Attributes { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -43,14 +43,14 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelRelationshipsInPatchRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateWriteOnlyChannelRequest? Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public WriteOnlyChannelRelationshipsInPatchRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public RelationshipsInUpdateWriteOnlyChannelRequest Relationships { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif @@ -60,21 +60,21 @@ public WriteOnlyChannelResourceType? Type { set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelDataInPatchRequest() + public DataInUpdateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelDataInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static DataInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelDataInPatchRequest(); + return new DataInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -84,9 +84,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(WriteOnlyChannelAttributesInPatchRequest.CreateFromDiscriminatorValue); } }, + {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(WriteOnlyChannelRelationshipsInPatchRequest.CreateFromDiscriminatorValue); } }, + {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, {"type", n => { Type = n.GetEnumValue(); } }, }; } @@ -97,9 +97,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPatchRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPatchRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs index 985ffdef5e..d98f215d15 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPatchRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelRelationshipsInPatchRequest : IBackedModel, IParsable + public class RelationshipsInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property @@ -55,21 +55,21 @@ public ToOneDataStreamInRequest VideoStream { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelRelationshipsInPatchRequest() + public RelationshipsInCreateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelRelationshipsInPatchRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelRelationshipsInPatchRequest(); + return new RelationshipsInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPostRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPostRequest.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs index a41d94fa82..b778c0881a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInPostRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelRelationshipsInPostRequest : IBackedModel, IParsable + public class RelationshipsInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property @@ -55,21 +55,21 @@ public ToOneDataStreamInRequest VideoStream { } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelRelationshipsInPostRequest() + public RelationshipsInUpdateWriteOnlyChannelRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelRelationshipsInPostRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static RelationshipsInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelRelationshipsInPostRequest(); + return new RelationshipsInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPatchRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs similarity index 65% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPatchRequestDocument.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs index 8b967fac29..43e5596cc9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPatchRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs @@ -7,7 +7,7 @@ using System; namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class WriteOnlyChannelPatchRequestDocument : IBackedModel, IParsable + public class UpdateWriteOnlyChannelRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +15,33 @@ public class WriteOnlyChannelPatchRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelDataInPatchRequest? Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateWriteOnlyChannelRequest? Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public WriteOnlyChannelDataInPatchRequest Data { - get { return BackingStore?.Get("data"); } + public DataInUpdateWriteOnlyChannelRequest Data { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public WriteOnlyChannelPatchRequestDocument() + public UpdateWriteOnlyChannelRequestDocument() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelPatchRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static UpdateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelPatchRequestDocument(); + return new UpdateWriteOnlyChannelRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +51,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(WriteOnlyChannelDataInPatchRequest.CreateFromDiscriminatorValue); } }, + {"data", n => { Data = n.GetObjectValue(DataInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +61,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPostRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPostRequestDocument.cs deleted file mode 100644 index da3eadcb3c..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPostRequestDocument.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class WriteOnlyChannelPostRequestDocument : IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// The data property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public WriteOnlyChannelDataInPostRequest? Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#nullable restore -#else - public WriteOnlyChannelDataInPostRequest Data { - get { return BackingStore?.Get("data"); } - set { BackingStore?.Set("data", value); } - } -#endif - /// - /// Instantiates a new and sets the default values. - /// - public WriteOnlyChannelPostRequestDocument() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelPostRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelPostRequestDocument(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - {"data", n => { Data = n.GetObjectValue(WriteOnlyChannelDataInPostRequest.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs index c5d0282ba9..b6e8eb36ef 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs @@ -71,11 +71,11 @@ public async Task DeleteAsync(ActionWhen receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(WriteOnlyChannelPatchRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(WriteOnlyChannelPatchRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -116,11 +116,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(WriteOnlyChannelPatchRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(WriteOnlyChannelPatchRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs index 01ec9663a9..d6c886eb65 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs @@ -57,11 +57,11 @@ public WriteOnlyChannelsRequestBuilder(string rawUrl, IRequestAdapter requestAda /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(WriteOnlyChannelPostRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(WriteOnlyChannelPostRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -84,11 +84,11 @@ public async Task PostAsync(WriteOnlyCh /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(WriteOnlyChannelPostRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(WriteOnlyChannelPostRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs index c8e2b890e8..c627d8525e 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs @@ -53,17 +53,17 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Type = WriteOnlyChannelResourceType.WriteOnlyChannels, Id = existingChannel.StringId!, - Attributes = new WriteOnlyChannelAttributesInPatchRequest + Attributes = new AttributesInUpdateWriteOnlyChannelRequest { Name = newChannelName }, - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { @@ -164,14 +164,14 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Type = WriteOnlyChannelResourceType.WriteOnlyChannels, Id = existingChannel.StringId!, - Attributes = new WriteOnlyChannelAttributesInPatchRequest(), - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest() + Attributes = new AttributesInUpdateWriteOnlyChannelRequest(), + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest() } }; @@ -238,7 +238,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - WriteOnlyChannelPatchRequestDocument requestBody = null!; + UpdateWriteOnlyChannelRequestDocument requestBody = null!; // Act Func action = async () => _ = await apiClient.WriteOnlyChannels[existingChannel.StringId].PatchAsync(requestBody); @@ -265,13 +265,13 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); var apiClient = new RestrictedControllersClient(requestAdapter); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Type = WriteOnlyChannelResourceType.WriteOnlyChannels, Id = existingChannel.StringId!, - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { diff --git a/test/OpenApiNSwagClientTests/LegacyOpenApi/PartialAttributeSerializationLifetimeTests.cs b/test/OpenApiNSwagClientTests/LegacyOpenApi/PartialAttributeSerializationLifetimeTests.cs index f4c60ee516..d67f4cd624 100644 --- a/test/OpenApiNSwagClientTests/LegacyOpenApi/PartialAttributeSerializationLifetimeTests.cs +++ b/test/OpenApiNSwagClientTests/LegacyOpenApi/PartialAttributeSerializationLifetimeTests.cs @@ -18,17 +18,17 @@ public async Task Disposed_registration_does_not_affect_request() const string airplaneId = "XUuiP"; - var requestDocument = new AirplanePatchRequestDocument + var requestDocument = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument, + using (apiClient.WithPartialAttributeSerialization(requestDocument, airplane => airplane.AirtimeInHours)) { _ = await ApiResponse.TranslateAsync(async () => await apiClient.PatchAirplaneAsync(airplaneId, null, requestDocument)); @@ -62,20 +62,20 @@ public async Task Registration_can_be_used_for_multiple_requests() const string airplaneId = "XUuiP"; - var requestDocument = new AirplanePatchRequestDocument + var requestDocument = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest + Attributes = new AttributesInUpdateAirplaneRequest { AirtimeInHours = 100 } } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument, + using (apiClient.WithPartialAttributeSerialization(requestDocument, airplane => airplane.AirtimeInHours)) { _ = await ApiResponse.TranslateAsync(async () => await apiClient.PatchAirplaneAsync(airplaneId, null, requestDocument)); @@ -111,32 +111,32 @@ public async Task Request_is_unaffected_by_registration_for_different_document_o const string airplaneId1 = "XUuiP"; - var requestDocument1 = new AirplanePatchRequestDocument + var requestDocument1 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId1, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; const string airplaneId2 = "DJy1u"; - var requestDocument2 = new AirplanePatchRequestDocument + var requestDocument2 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId2, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument1, + using (apiClient.WithPartialAttributeSerialization(requestDocument1, airplane => airplane.AirtimeInHours)) { - using (apiClient.WithPartialAttributeSerialization(requestDocument2, + using (apiClient.WithPartialAttributeSerialization(requestDocument2, airplane => airplane.SerialNumber)) { } @@ -168,20 +168,20 @@ public async Task Attribute_values_can_be_changed_after_registration() const string airplaneId = "XUuiP"; - var requestDocument = new AirplanePatchRequestDocument + var requestDocument = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest + Attributes = new AttributesInUpdateAirplaneRequest { IsInMaintenance = true } } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument, + using (apiClient.WithPartialAttributeSerialization(requestDocument, airplane => airplane.IsInMaintenance)) { requestDocument.Data.Attributes.IsInMaintenance = false; @@ -213,29 +213,29 @@ public async Task Registration_is_unaffected_by_successive_registration_for_docu const string airplaneId1 = "XUuiP"; - var requestDocument1 = new AirplanePatchRequestDocument + var requestDocument1 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId1, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; - var requestDocument2 = new AirplanePostRequestDocument + var requestDocument2 = new CreateAirplaneRequestDocument { - Data = new AirplaneDataInPostRequest + Data = new DataInCreateAirplaneRequest { Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPostRequest() + Attributes = new AttributesInCreateAirplaneRequest() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument1, + using (apiClient.WithPartialAttributeSerialization(requestDocument1, airplane => airplane.IsInMaintenance)) { - using (apiClient.WithPartialAttributeSerialization(requestDocument2, + using (apiClient.WithPartialAttributeSerialization(requestDocument2, airplane => airplane.AirtimeInHours)) { // Act @@ -266,17 +266,17 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ const string airplaneId1 = "XUuiP"; - var requestDocument1 = new AirplanePatchRequestDocument + var requestDocument1 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId1, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument1, + using (apiClient.WithPartialAttributeSerialization(requestDocument1, airplane => airplane.AirtimeInHours)) { _ = await ApiResponse.TranslateAsync(async () => await apiClient.PatchAirplaneAsync(airplaneId1, null, requestDocument1)); @@ -284,13 +284,13 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ const string airplaneId2 = "DJy1u"; - var requestDocument2 = new AirplanePatchRequestDocument + var requestDocument2 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId2, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest + Attributes = new AttributesInUpdateAirplaneRequest { ManufacturedInCity = "Everett" } @@ -299,7 +299,7 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ wrapper.ChangeResponse(HttpStatusCode.NoContent, null); - using (apiClient.WithPartialAttributeSerialization(requestDocument2, + using (apiClient.WithPartialAttributeSerialization(requestDocument2, airplane => airplane.SerialNumber)) { // Act @@ -328,19 +328,19 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - var requestDocument1 = new AirplanePostRequestDocument + var requestDocument1 = new CreateAirplaneRequestDocument { - Data = new AirplaneDataInPostRequest + Data = new DataInCreateAirplaneRequest { Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPostRequest + Attributes = new AttributesInCreateAirplaneRequest { Name = "Jay Jay the Jet Plane" } } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument1, + using (apiClient.WithPartialAttributeSerialization(requestDocument1, airplane => airplane.AirtimeInHours)) { _ = await ApiResponse.TranslateAsync(async () => await apiClient.PostAirplaneAsync(null, requestDocument1)); @@ -348,13 +348,13 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ const string airplaneId = "DJy1u"; - var requestDocument2 = new AirplanePatchRequestDocument + var requestDocument2 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest + Attributes = new AttributesInUpdateAirplaneRequest { ManufacturedInCity = "Everett" } @@ -363,7 +363,7 @@ public async Task Registration_is_unaffected_by_preceding_disposed_registration_ wrapper.ChangeResponse(HttpStatusCode.NoContent, null); - using (apiClient.WithPartialAttributeSerialization(requestDocument2, + using (apiClient.WithPartialAttributeSerialization(requestDocument2, airplane => airplane.SerialNumber)) { // Act @@ -394,32 +394,32 @@ public async Task Registration_is_unaffected_by_preceding_registration_for_diffe const string airplaneId1 = "XUuiP"; - var requestDocument1 = new AirplanePatchRequestDocument + var requestDocument1 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId1, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; const string airplaneId2 = "DJy1u"; - var requestDocument2 = new AirplanePatchRequestDocument + var requestDocument2 = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId2, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest() + Attributes = new AttributesInUpdateAirplaneRequest() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument1, + using (apiClient.WithPartialAttributeSerialization(requestDocument1, airplane => airplane.SerialNumber)) { - using (apiClient.WithPartialAttributeSerialization(requestDocument2, + using (apiClient.WithPartialAttributeSerialization(requestDocument2, airplane => airplane.IsInMaintenance, airplane => airplane.AirtimeInHours)) { // Act diff --git a/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs b/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs index 0984d20372..2881c550d6 100644 --- a/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs +++ b/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs @@ -60,12 +60,12 @@ public async Task Partial_posting_resource_with_selected_relationships_produces_ using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - var requestDocument = new FlightPostRequestDocument + var requestDocument = new CreateFlightRequestDocument { - Data = new FlightDataInPostRequest + Data = new DataInCreateFlightRequest { Type = FlightResourceType.Flights, - Relationships = new FlightRelationshipsInPostRequest + Relationships = new RelationshipsInCreateFlightRequest { Purser = new ToOneFlightAttendantInRequest { @@ -142,12 +142,12 @@ public async Task Partial_posting_resource_produces_expected_request() string name = $"anAirplaneName {specialCharacters}"; - var requestDocument = new AirplanePostRequestDocument + var requestDocument = new CreateAirplaneRequestDocument { - Data = new AirplaneDataInPostRequest + Data = new DataInCreateAirplaneRequest { Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPostRequest + Attributes = new AttributesInCreateAirplaneRequest { Name = name, AirtimeInHours = 800 @@ -155,7 +155,7 @@ public async Task Partial_posting_resource_produces_expected_request() } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument, + using (apiClient.WithPartialAttributeSerialization(requestDocument, airplane => airplane.SerialNumber)) { // Act @@ -195,20 +195,20 @@ public async Task Partial_patching_resource_produces_expected_request() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - var requestDocument = new AirplanePatchRequestDocument + var requestDocument = new UpdateAirplaneRequestDocument { - Data = new AirplaneDataInPatchRequest + Data = new DataInUpdateAirplaneRequest { Id = airplaneId, Type = AirplaneResourceType.Airplanes, - Attributes = new AirplaneAttributesInPatchRequest + Attributes = new AttributesInUpdateAirplaneRequest { LastServicedAt = lastServicedAt } } }; - using (apiClient.WithPartialAttributeSerialization(requestDocument, + using (apiClient.WithPartialAttributeSerialization(requestDocument, airplane => airplane.SerialNumber, airplane => airplane.LastServicedAt, airplane => airplane.IsInMaintenance, airplane => airplane.AirtimeInHours)) { // Act @@ -389,19 +389,19 @@ public async Task Posting_ToMany_relationship_produces_expected_request() var requestDocument = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Type = FlightAttendantResourceType.FlightAttendants, Id = "bBJHu" }, - new() + new FlightAttendantIdentifier { Type = FlightAttendantResourceType.FlightAttendants, Id = "NInmX" } - } + ] }; // Act @@ -442,19 +442,19 @@ public async Task Patching_ToMany_relationship_produces_expected_request() var requestDocument = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants }, - new() + new FlightAttendantIdentifier { Id = "NInmX", Type = FlightAttendantResourceType.FlightAttendants } - } + ] }; // Act @@ -495,19 +495,19 @@ public async Task Deleting_ToMany_relationship_produces_expected_request() var requestDocument = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants }, - new() + new FlightAttendantIdentifier { Id = "NInmX", Type = FlightAttendantResourceType.FlightAttendants } - } + ] }; // Act diff --git a/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs b/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs index fe2b44ed34..e72266965e 100644 --- a/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs +++ b/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs @@ -295,13 +295,12 @@ public async Task Posting_resource_translates_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.Created, responseBody); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - FlightPrimaryResponseDocument document = await apiClient.PostFlightAsync(null, new FlightPostRequestDocument + var requestBody = new CreateFlightRequestDocument { - Data = new FlightDataInPostRequest + Data = new DataInCreateFlightRequest { Type = FlightResourceType.Flights, - Relationships = new FlightRelationshipsInPostRequest + Relationships = new RelationshipsInCreateFlightRequest { Purser = new ToOneFlightAttendantInRequest { @@ -313,7 +312,10 @@ public async Task Posting_resource_translates_response() } } } - }); + }; + + // Act + FlightPrimaryResponseDocument document = await apiClient.PostFlightAsync(null, requestBody); // Assert document.Data.Attributes.Should().BeNull(); @@ -349,15 +351,17 @@ public async Task Patching_resource_with_side_effects_translates_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.OK, responseBody); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - FlightPrimaryResponseDocument document = await apiClient.PatchFlightAsync(flightId, null, new FlightPatchRequestDocument + var requestBody = new UpdateFlightRequestDocument { - Data = new FlightDataInPatchRequest + Data = new DataInUpdateFlightRequest { Id = flightId, Type = FlightResourceType.Flights } - }); + }; + + // Act + FlightPrimaryResponseDocument document = await apiClient.PatchFlightAsync(flightId, null, requestBody); // Assert document.Data.Attributes.Should().BeNull(); @@ -374,9 +378,9 @@ public async Task Patching_resource_without_side_effects_translates_response() // Act FlightPrimaryResponseDocument? document = await ApiResponse.TranslateAsync(async () => await apiClient.PatchFlightAsync(flightId, null, - new FlightPatchRequestDocument + new UpdateFlightRequestDocument { - Data = new FlightDataInPatchRequest + Data = new DataInUpdateFlightRequest { Id = flightId, Type = FlightResourceType.Flights @@ -582,15 +586,17 @@ public async Task Patching_ToOne_relationship_translates_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - await apiClient.PatchFlightPurserRelationshipAsync("ZvuH1", new ToOneFlightAttendantInRequest + var requestBody = new ToOneFlightAttendantInRequest { Data = new FlightAttendantIdentifier { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants } - }); + }; + + // Act + await apiClient.PatchFlightPurserRelationshipAsync("ZvuH1", requestBody); } [Fact] @@ -640,23 +646,25 @@ public async Task Posting_ToMany_relationship_produces_empty_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - Func action = async () => await apiClient.PostFlightCabinCrewMembersRelationshipAsync("ZvuH1", new ToManyFlightAttendantInRequest + var requestBody = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new() + new FlightAttendantIdentifier { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants } - } - }); + ] + }; + + // Act + Func action = async () => await apiClient.PostFlightCabinCrewMembersRelationshipAsync("ZvuH1", requestBody); // Assert await action.Should().NotThrowAsync(); @@ -669,23 +677,25 @@ public async Task Patching_ToMany_relationship_produces_empty_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - Func action = async () => await apiClient.PatchFlightCabinCrewMembersRelationshipAsync("ZvuH1", new ToManyFlightAttendantInRequest + var requestBody = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new() + new FlightAttendantIdentifier { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants } - } - }); + ] + }; + + // Act + Func action = async () => await apiClient.PatchFlightCabinCrewMembersRelationshipAsync("ZvuH1", requestBody); // Assert await action.Should().NotThrowAsync(); @@ -698,23 +708,25 @@ public async Task Deleting_ToMany_relationship_produces_empty_response() using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); ILegacyClient apiClient = new LegacyClient(wrapper.HttpClient); - // Act - Func action = async () => await apiClient.DeleteFlightCabinCrewMembersRelationshipAsync("ZvuH1", new ToManyFlightAttendantInRequest + var requestBody = new ToManyFlightAttendantInRequest { - Data = new List - { - new() + Data = + [ + new FlightAttendantIdentifier { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new() + new FlightAttendantIdentifier { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants } - } - }); + ] + }; + + // Act + Func action = async () => await apiClient.DeleteFlightCabinCrewMembersRelationshipAsync("ZvuH1", requestBody); // Assert await action.Should().NotThrowAsync(); diff --git a/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs index 18bf877654..aa3105b539 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs @@ -47,19 +47,20 @@ public void Generated_endpoint_methods_are_named_as_expected() public void Generated_top_level_document_types_are_named_as_expected() { _ = nameof(SupermarketCollectionResponseDocument); - _ = nameof(SupermarketPostRequestDocument); + _ = nameof(CreateSupermarketRequestDocument); _ = nameof(SupermarketPrimaryResponseDocument); - _ = nameof(SupermarketPatchRequestDocument); + _ = nameof(UpdateSupermarketRequestDocument); _ = nameof(StaffMemberCollectionResponseDocument); - _ = nameof(StaffMemberPostRequestDocument); + _ = nameof(CreateStaffMemberRequestDocument); _ = nameof(StaffMemberPrimaryResponseDocument); - _ = nameof(StaffMemberPatchRequestDocument); + _ = nameof(UpdateStaffMemberRequestDocument); _ = nameof(StaffMemberIdentifierCollectionResponseDocument); _ = nameof(StaffMemberIdentifierResponseDocument); _ = nameof(StaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberIdentifierResponseDocument); + _ = nameof(ErrorResponseDocument); } @@ -73,32 +74,33 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorTopLevelLinks); _ = nameof(ResourceLinks); _ = nameof(RelationshipLinks); + _ = nameof(ErrorLinks); } [Fact] public void Generated_resource_field_types_are_named_as_expected() { - _ = nameof(SupermarketAttributesInPostRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPostRequest.Kind); - _ = nameof(SupermarketAttributesInPatchRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPatchRequest.Kind); + _ = nameof(AttributesInCreateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInCreateSupermarketRequest.Kind); + _ = nameof(AttributesInUpdateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInUpdateSupermarketRequest.Kind); _ = nameof(SupermarketAttributesInResponse.NameOfCity); _ = nameof(SupermarketAttributesInResponse.Kind); - _ = nameof(SupermarketRelationshipsInPostRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.Cashiers); - _ = nameof(SupermarketRelationshipsInPatchRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.Cashiers); + _ = nameof(RelationshipsInCreateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.Cashiers); + _ = nameof(RelationshipsInUpdateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.Cashiers); _ = nameof(SupermarketRelationshipsInResponse.StoreManager); _ = nameof(SupermarketRelationshipsInResponse.BackupStoreManager); _ = nameof(SupermarketRelationshipsInResponse.Cashiers); _ = nameof(SupermarketType); - _ = nameof(StaffMemberAttributesInPostRequest.Name); - _ = nameof(StaffMemberAttributesInPostRequest.Age); - _ = nameof(StaffMemberAttributesInPatchRequest.Name); - _ = nameof(StaffMemberAttributesInPatchRequest.Age); + _ = nameof(AttributesInCreateStaffMemberRequest.Name); + _ = nameof(AttributesInCreateStaffMemberRequest.Age); + _ = nameof(AttributesInUpdateStaffMemberRequest.Name); + _ = nameof(AttributesInUpdateStaffMemberRequest.Age); _ = nameof(StaffMemberAttributesInResponse.Name); _ = nameof(StaffMemberAttributesInResponse.Age); } @@ -124,22 +126,24 @@ public void Generated_resource_type_enums_are_named_as_expected() [Fact] public void Generated_data_types_are_named_as_expected() { - _ = nameof(SupermarketDataInPostRequest); - _ = nameof(SupermarketDataInPatchRequest); + _ = nameof(DataInResponse); + + _ = nameof(DataInCreateSupermarketRequest); + _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); - _ = nameof(StaffMemberDataInPostRequest); - _ = nameof(StaffMemberDataInPatchRequest); + _ = nameof(DataInCreateStaffMemberRequest); + _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(DataInResponse); - _ = nameof(StaffMemberIdentifier); } [Fact] - public void Generated_code_is_named_as_expected() + public void Generated_predefined_types_are_named_as_expected() { _ = nameof(Jsonapi); + _ = nameof(ErrorObject); + _ = nameof(ErrorSource); } } diff --git a/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs index 18e043b488..9d18f6ead7 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs @@ -47,19 +47,20 @@ public void Generated_endpoint_methods_are_named_as_expected() public void Generated_top_level_document_types_are_named_as_expected() { _ = nameof(SupermarketCollectionResponseDocument); - _ = nameof(SupermarketPostRequestDocument); + _ = nameof(CreateSupermarketRequestDocument); _ = nameof(SupermarketPrimaryResponseDocument); - _ = nameof(SupermarketPatchRequestDocument); + _ = nameof(UpdateSupermarketRequestDocument); _ = nameof(StaffMemberCollectionResponseDocument); - _ = nameof(StaffMemberPostRequestDocument); + _ = nameof(CreateStaffMemberRequestDocument); _ = nameof(StaffMemberPrimaryResponseDocument); - _ = nameof(StaffMemberPatchRequestDocument); + _ = nameof(UpdateStaffMemberRequestDocument); _ = nameof(StaffMemberIdentifierCollectionResponseDocument); _ = nameof(StaffMemberIdentifierResponseDocument); _ = nameof(StaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberIdentifierResponseDocument); + _ = nameof(ErrorResponseDocument); } @@ -73,32 +74,33 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorTopLevelLinks); _ = nameof(ResourceLinks); _ = nameof(RelationshipLinks); + _ = nameof(ErrorLinks); } [Fact] public void Generated_resource_field_types_are_named_as_expected() { - _ = nameof(SupermarketAttributesInPostRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPostRequest.Kind); - _ = nameof(SupermarketAttributesInPatchRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPatchRequest.Kind); + _ = nameof(AttributesInCreateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInCreateSupermarketRequest.Kind); + _ = nameof(AttributesInUpdateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInUpdateSupermarketRequest.Kind); _ = nameof(SupermarketAttributesInResponse.NameOfCity); _ = nameof(SupermarketAttributesInResponse.Kind); - _ = nameof(SupermarketRelationshipsInPostRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.Cashiers); - _ = nameof(SupermarketRelationshipsInPatchRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.Cashiers); + _ = nameof(RelationshipsInCreateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.Cashiers); + _ = nameof(RelationshipsInUpdateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.Cashiers); _ = nameof(SupermarketRelationshipsInResponse.StoreManager); _ = nameof(SupermarketRelationshipsInResponse.BackupStoreManager); _ = nameof(SupermarketRelationshipsInResponse.Cashiers); _ = nameof(SupermarketType); - _ = nameof(StaffMemberAttributesInPostRequest.Name); - _ = nameof(StaffMemberAttributesInPostRequest.Age); - _ = nameof(StaffMemberAttributesInPatchRequest.Name); - _ = nameof(StaffMemberAttributesInPatchRequest.Age); + _ = nameof(AttributesInCreateStaffMemberRequest.Name); + _ = nameof(AttributesInCreateStaffMemberRequest.Age); + _ = nameof(AttributesInUpdateStaffMemberRequest.Name); + _ = nameof(AttributesInUpdateStaffMemberRequest.Age); _ = nameof(StaffMemberAttributesInResponse.Name); _ = nameof(StaffMemberAttributesInResponse.Age); } @@ -124,22 +126,24 @@ public void Generated_resource_type_enums_are_named_as_expected() [Fact] public void Generated_data_types_are_named_as_expected() { - _ = nameof(SupermarketDataInPostRequest); - _ = nameof(SupermarketDataInPatchRequest); + _ = nameof(DataInResponse); + + _ = nameof(DataInCreateSupermarketRequest); + _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); - _ = nameof(StaffMemberDataInPostRequest); - _ = nameof(StaffMemberDataInPatchRequest); + _ = nameof(DataInCreateStaffMemberRequest); + _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(DataInResponse); - _ = nameof(StaffMemberIdentifier); } [Fact] - public void Generated_code_is_named_as_expected() + public void Generated_predefined_types_are_named_as_expected() { _ = nameof(Jsonapi); + _ = nameof(ErrorObject); + _ = nameof(ErrorSource); } } diff --git a/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs index b78c7bfa4f..3fd5aa9116 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs @@ -47,19 +47,20 @@ public void Generated_endpoint_methods_are_named_as_expected() public void Generated_top_level_document_types_are_named_as_expected() { _ = nameof(SupermarketCollectionResponseDocument); - _ = nameof(SupermarketPostRequestDocument); + _ = nameof(CreateSupermarketRequestDocument); _ = nameof(SupermarketPrimaryResponseDocument); - _ = nameof(SupermarketPatchRequestDocument); + _ = nameof(UpdateSupermarketRequestDocument); _ = nameof(StaffMemberCollectionResponseDocument); - _ = nameof(StaffMemberPostRequestDocument); + _ = nameof(CreateStaffMemberRequestDocument); _ = nameof(StaffMemberPrimaryResponseDocument); - _ = nameof(StaffMemberPatchRequestDocument); + _ = nameof(UpdateStaffMemberRequestDocument); _ = nameof(StaffMemberIdentifierCollectionResponseDocument); _ = nameof(StaffMemberIdentifierResponseDocument); _ = nameof(StaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberSecondaryResponseDocument); _ = nameof(NullableStaffMemberIdentifierResponseDocument); + _ = nameof(ErrorResponseDocument); } @@ -73,32 +74,33 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorTopLevelLinks); _ = nameof(ResourceLinks); _ = nameof(RelationshipLinks); + _ = nameof(ErrorLinks); } [Fact] public void Generated_resource_field_types_are_named_as_expected() { - _ = nameof(SupermarketAttributesInPostRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPostRequest.Kind); - _ = nameof(SupermarketAttributesInPatchRequest.NameOfCity); - _ = nameof(SupermarketAttributesInPatchRequest.Kind); + _ = nameof(AttributesInCreateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInCreateSupermarketRequest.Kind); + _ = nameof(AttributesInUpdateSupermarketRequest.NameOfCity); + _ = nameof(AttributesInUpdateSupermarketRequest.Kind); _ = nameof(SupermarketAttributesInResponse.NameOfCity); _ = nameof(SupermarketAttributesInResponse.Kind); - _ = nameof(SupermarketRelationshipsInPostRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPostRequest.Cashiers); - _ = nameof(SupermarketRelationshipsInPatchRequest.StoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.BackupStoreManager); - _ = nameof(SupermarketRelationshipsInPatchRequest.Cashiers); + _ = nameof(RelationshipsInCreateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInCreateSupermarketRequest.Cashiers); + _ = nameof(RelationshipsInUpdateSupermarketRequest.StoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.BackupStoreManager); + _ = nameof(RelationshipsInUpdateSupermarketRequest.Cashiers); _ = nameof(SupermarketRelationshipsInResponse.StoreManager); _ = nameof(SupermarketRelationshipsInResponse.BackupStoreManager); _ = nameof(SupermarketRelationshipsInResponse.Cashiers); _ = nameof(SupermarketType); - _ = nameof(StaffMemberAttributesInPostRequest.Name); - _ = nameof(StaffMemberAttributesInPostRequest.Age); - _ = nameof(StaffMemberAttributesInPatchRequest.Name); - _ = nameof(StaffMemberAttributesInPatchRequest.Age); + _ = nameof(AttributesInCreateStaffMemberRequest.Name); + _ = nameof(AttributesInCreateStaffMemberRequest.Age); + _ = nameof(AttributesInUpdateStaffMemberRequest.Name); + _ = nameof(AttributesInUpdateStaffMemberRequest.Age); _ = nameof(StaffMemberAttributesInResponse.Name); _ = nameof(StaffMemberAttributesInResponse.Age); } @@ -124,22 +126,24 @@ public void Generated_resource_type_enums_are_named_as_expected() [Fact] public void Generated_data_types_are_named_as_expected() { - _ = nameof(SupermarketDataInPostRequest); - _ = nameof(SupermarketDataInPatchRequest); + _ = nameof(DataInResponse); + + _ = nameof(DataInCreateSupermarketRequest); + _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); - _ = nameof(StaffMemberDataInPostRequest); - _ = nameof(StaffMemberDataInPatchRequest); + _ = nameof(DataInCreateStaffMemberRequest); + _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(DataInResponse); - _ = nameof(StaffMemberIdentifier); } [Fact] - public void Generated_code_is_named_as_expected() + public void Generated_predefined_types_are_named_as_expected() { _ = nameof(Jsonapi); + _ = nameof(ErrorObject); + _ = nameof(ErrorSource); } } diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs index 62ca68d887..52125297dc 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs @@ -16,21 +16,21 @@ public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests private readonly NrtOffMsvOffFakers _fakers = new(); [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), "requiredReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -45,8 +45,8 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOffClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -63,18 +63,18 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -89,7 +89,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PostResourceAsync(null, requestDocument)); @@ -104,18 +104,18 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), "requiredReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Cannot_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -130,7 +130,7 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act Func action = async () => await apiClient.PostResourceAsync(null, requestDocument); @@ -143,17 +143,17 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), "toOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToOne), "requiredToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToOne), "requiredToOne")] public async Task Can_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -181,17 +181,17 @@ public async Task Can_clear_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Cannot_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -217,17 +217,17 @@ public async Task Cannot_clear_relationship(string relationshipPropertyName, str } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), "toOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs index 32f67157bd..0534ad07e1 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs @@ -5,11 +5,11 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes internal sealed class NrtOffMsvOffFakers { - private readonly Lazy> _lazyPostAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPostAttributesFaker = new(() => + FakerFactory.Instance.Create()); - private readonly Lazy> _lazyPatchAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPatchAttributesFaker = new(() => + FakerFactory.Instance.Create()); private readonly Lazy> _lazyNullableToOneFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); @@ -17,8 +17,8 @@ internal sealed class NrtOffMsvOffFakers private readonly Lazy> _lazyToManyFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); - public Faker PostAttributes => _lazyPostAttributesFaker.Value; - public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; + public Faker PostAttributes => _lazyPostAttributesFaker.Value; + public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; public Faker NullableToOne => _lazyNullableToOneFaker.Value; public Faker ToMany => _lazyToManyFaker.Value; } diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs index dd0da75e35..2b1d88fe67 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs @@ -9,16 +9,16 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes public sealed class NullabilityTests { [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), NullabilityState.Unknown)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), NullabilityState.Unknown)] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), NullabilityState.Unknown)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), NullabilityState.Unknown)] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), NullabilityState.Nullable)] public void Nullability_of_generated_attribute_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? property = typeof(ResourceAttributesInPostRequest).GetProperty(propertyName); + PropertyInfo? property = typeof(AttributesInCreateResourceRequest).GetProperty(propertyName); // Assert property.ShouldNotBeNull(); @@ -26,14 +26,14 @@ public void Nullability_of_generated_attribute_property_is_as_expected(string pr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToOne), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToOne), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToOne), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), NullabilityState.Unknown)] public void Nullability_of_generated_relationship_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? relationshipProperty = typeof(ResourceRelationshipsInPostRequest).GetProperty(propertyName); + PropertyInfo? relationshipProperty = typeof(RelationshipsInCreateResourceRequest).GetProperty(propertyName); // Assert relationshipProperty.ShouldNotBeNull(); diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs index 92e5cd452e..2c6a410caf 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs @@ -18,12 +18,12 @@ public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests public async Task Cannot_omit_Id() { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -46,22 +46,22 @@ public async Task Cannot_omit_Id() } [Theory] - [InlineData(nameof(ResourceAttributesInPatchRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredReferenceType), "requiredReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), @@ -76,7 +76,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PatchResourceAsync(requestDocument.Data.Id, null, requestDocument)); @@ -91,20 +91,20 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToOne), "toOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToOne), "requiredToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToOne), "requiredToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.NullableToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs index ec9e0b969c..62c08d70d1 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs @@ -16,20 +16,20 @@ public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests private readonly NrtOffMsvOnFakers _fakers = new(); [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -44,8 +44,8 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOnClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -62,16 +62,16 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), "requiredReferenceType")] public async Task Cannot_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -86,8 +86,8 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOnClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -101,19 +101,19 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -128,7 +128,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PostResourceAsync(null, requestDocument)); @@ -143,17 +143,17 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), "requiredReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Cannot_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -168,7 +168,7 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act Func action = async () => await apiClient.PostResourceAsync(null, requestDocument); @@ -181,16 +181,16 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToOne), "toOne")] public async Task Can_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -218,18 +218,18 @@ public async Task Can_clear_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToOne), "requiredToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToOne), "requiredToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Cannot_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -255,18 +255,18 @@ public async Task Cannot_clear_relationship(string relationshipPropertyName, str } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), "toOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -294,16 +294,16 @@ public async Task Can_omit_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToOne), "requiredToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToOne), "requiredToOne")] public async Task Cannot_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs index 0ce74c214c..2d048bffeb 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs @@ -5,11 +5,11 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes internal sealed class NrtOffMsvOnFakers { - private readonly Lazy> _lazyPostAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPostAttributesFaker = new(() => + FakerFactory.Instance.Create()); - private readonly Lazy> _lazyPatchAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPatchAttributesFaker = new(() => + FakerFactory.Instance.Create()); private readonly Lazy> _lazyToOneFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); @@ -20,8 +20,8 @@ internal sealed class NrtOffMsvOnFakers private readonly Lazy> _lazyToManyFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); - public Faker PostAttributes => _lazyPostAttributesFaker.Value; - public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; + public Faker PostAttributes => _lazyPostAttributesFaker.Value; + public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; public Faker ToOne => _lazyToOneFaker.Value; public Faker NullableToOne => _lazyNullableToOneFaker.Value; public Faker ToMany => _lazyToManyFaker.Value; diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs index 9b0c3e7b1d..989c7a60fe 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs @@ -9,16 +9,16 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes public sealed class NullabilityTests { [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.ReferenceType), NullabilityState.Unknown)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredReferenceType), NullabilityState.Unknown)] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.ReferenceType), NullabilityState.Unknown)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredReferenceType), NullabilityState.Unknown)] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), NullabilityState.NotNull)] public void Nullability_of_generated_attribute_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? property = typeof(ResourceAttributesInPostRequest).GetProperty(propertyName); + PropertyInfo? property = typeof(AttributesInCreateResourceRequest).GetProperty(propertyName); // Assert property.ShouldNotBeNull(); @@ -26,14 +26,14 @@ public void Nullability_of_generated_attribute_property_is_as_expected(string pr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToOne), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToOne), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), NullabilityState.Unknown)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToOne), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToOne), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), NullabilityState.Unknown)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), NullabilityState.Unknown)] public void Nullability_of_generated_relationship_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? relationshipProperty = typeof(ResourceRelationshipsInPostRequest).GetProperty(propertyName); + PropertyInfo? relationshipProperty = typeof(RelationshipsInCreateResourceRequest).GetProperty(propertyName); // Assert relationshipProperty.ShouldNotBeNull(); diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs index 7bc48da908..708e4d9004 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs @@ -18,12 +18,12 @@ public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests public async Task Cannot_omit_Id() { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -46,22 +46,22 @@ public async Task Cannot_omit_Id() } [Theory] - [InlineData(nameof(ResourceAttributesInPatchRequest.ReferenceType), "referenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredReferenceType), "requiredReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ReferenceType), "referenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredReferenceType), "requiredReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), @@ -76,7 +76,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOffMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PatchResourceAsync(requestDocument.Data.Id, null, requestDocument)); @@ -91,20 +91,20 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToOne), "toOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToOne), "requiredToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToOne), "toOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToOne), "requiredToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { ToOne = _fakers.NullableToOne.Generate(), RequiredToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs index 87b1e1bd21..b67f4cbf6a 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs @@ -16,21 +16,21 @@ public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests private readonly NrtOnMsvOffFakers _fakers = new(); [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -47,8 +47,8 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOffClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -65,17 +65,17 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] public async Task Cannot_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -92,8 +92,8 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOffClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -108,19 +108,19 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -137,7 +137,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PostResourceAsync(null, requestDocument)); @@ -152,19 +152,19 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Cannot_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -181,7 +181,7 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act Func action = async () => await apiClient.PostResourceAsync(null, requestDocument); @@ -194,17 +194,17 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), "nullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNullableToOne), "requiredNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNullableToOne), "requiredNullableToOne")] public async Task Can_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -234,19 +234,19 @@ public async Task Can_clear_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Cannot_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -274,18 +274,18 @@ public async Task Cannot_clear_relationship(string relationshipPropertyName, str } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), "nullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -315,16 +315,16 @@ public async Task Can_omit_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] public async Task Cannot_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs index 99a015b6a2..5c52bbe002 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs @@ -5,11 +5,11 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes internal sealed class NrtOnMsvOffFakers { - private readonly Lazy> _lazyPostAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPostAttributesFaker = new(() => + FakerFactory.Instance.Create()); - private readonly Lazy> _lazyPatchAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPatchAttributesFaker = new(() => + FakerFactory.Instance.Create()); private readonly Lazy> _lazyToOneFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); @@ -20,8 +20,8 @@ internal sealed class NrtOnMsvOffFakers private readonly Lazy> _lazyToManyFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); - public Faker PostAttributes => _lazyPostAttributesFaker.Value; - public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; + public Faker PostAttributes => _lazyPostAttributesFaker.Value; + public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; public Faker ToOne => _lazyToOneFaker.Value; public Faker NullableToOne => _lazyNullableToOneFaker.Value; public Faker ToMany => _lazyToManyFaker.Value; diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs index 609d64bb15..87cb770fb2 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs @@ -9,18 +9,18 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes public sealed class NullabilityTests { [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), NullabilityState.Nullable)] public void Nullability_of_generated_attribute_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? property = typeof(ResourceAttributesInPostRequest).GetProperty(propertyName); + PropertyInfo? property = typeof(AttributesInCreateResourceRequest).GetProperty(propertyName); // Assert property.ShouldNotBeNull(); @@ -28,16 +28,16 @@ public void Nullability_of_generated_attribute_property_is_as_expected(string pr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), NullabilityState.Nullable)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNullableToOne), NullabilityState.Nullable)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), NullabilityState.Nullable)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNullableToOne), NullabilityState.Nullable)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), NullabilityState.NotNull)] public void Nullability_of_generated_relationship_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? relationshipProperty = typeof(ResourceRelationshipsInPostRequest).GetProperty(propertyName); + PropertyInfo? relationshipProperty = typeof(RelationshipsInCreateResourceRequest).GetProperty(propertyName); // Assert relationshipProperty.ShouldNotBeNull(); diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs index 39b5edfc2f..476dfedfe0 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs @@ -18,12 +18,12 @@ public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests public async Task Cannot_omit_Id() { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -48,24 +48,24 @@ public async Task Cannot_omit_Id() } [Theory] - [InlineData(nameof(ResourceAttributesInPatchRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -82,7 +82,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOffClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PatchResourceAsync(requestDocument.Data.Id, null, requestDocument)); @@ -97,22 +97,22 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.NullableToOne), "nullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredNullableToOne), "requiredNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredNullableToOne), "requiredNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs index 29e04ee849..8881b85cb6 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs @@ -16,20 +16,20 @@ public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests private readonly NrtOnMsvOnFakers _fakers = new(); [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -46,8 +46,8 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOnClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -64,18 +64,18 @@ public async Task Can_set_attribute_to_default_value(string attributePropertyNam } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] public async Task Cannot_set_attribute_to_default_value(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -92,8 +92,8 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOnClient(wrapper.HttpClient); - Expression> includeAttributeSelector = - CreateAttributeSelectorFor(attributePropertyName); + Expression> includeAttributeSelector = + CreateAttributeSelectorFor(attributePropertyName); using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument, includeAttributeSelector); @@ -107,19 +107,19 @@ public async Task Cannot_set_attribute_to_default_value(string attributeProperty } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), "nullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -136,7 +136,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PostResourceAsync(null, requestDocument)); @@ -151,19 +151,19 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Cannot_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -180,7 +180,7 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act Func action = async () => await apiClient.PostResourceAsync(null, requestDocument); @@ -193,16 +193,16 @@ public async Task Cannot_omit_attribute(string attributePropertyName, string jso } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), "nullableToOne")] public async Task Can_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -232,20 +232,20 @@ public async Task Can_clear_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNullableToOne), "requiredNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNullableToOne), "requiredNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Cannot_clear_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -273,18 +273,18 @@ public async Task Cannot_clear_relationship(string relationshipPropertyName, str } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), "nullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -314,18 +314,18 @@ public async Task Can_omit_relationship(string relationshipPropertyName, string } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNullableToOne), "requiredNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNullableToOne), "requiredNullableToOne")] public async Task Cannot_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePostRequestDocument + var requestDocument = new CreateResourceRequestDocument { - Data = new ResourceDataInPostRequest + Data = new DataInCreateResourceRequest { Attributes = _fakers.PostAttributes.Generate(), - Relationships = new ResourceRelationshipsInPostRequest + Relationships = new RelationshipsInCreateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs index acf9821095..0e1ed884f6 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs @@ -5,11 +5,11 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes internal sealed class NrtOnMsvOnFakers { - private readonly Lazy> _lazyPostAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPostAttributesFaker = new(() => + FakerFactory.Instance.Create()); - private readonly Lazy> _lazyPatchAttributesFaker = new(() => - FakerFactory.Instance.Create()); + private readonly Lazy> _lazyPatchAttributesFaker = new(() => + FakerFactory.Instance.Create()); private readonly Lazy> _lazyToOneFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); @@ -20,8 +20,8 @@ internal sealed class NrtOnMsvOnFakers private readonly Lazy> _lazyToManyFaker = new(() => FakerFactory.Instance.CreateForObjectWithResourceId()); - public Faker PostAttributes => _lazyPostAttributesFaker.Value; - public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; + public Faker PostAttributes => _lazyPostAttributesFaker.Value; + public Faker PatchAttributes => _lazyPatchAttributesFaker.Value; public Faker ToOne => _lazyToOneFaker.Value; public Faker NullableToOne => _lazyNullableToOneFaker.Value; public Faker ToMany => _lazyToManyFaker.Value; diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs index 10b3b1b2f2..452ecf0bc9 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs @@ -9,18 +9,18 @@ namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypes public sealed class NullabilityTests { [Theory] - [InlineData(nameof(ResourceAttributesInPostRequest.NonNullableReferenceType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNonNullableReferenceType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableReferenceType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableReferenceType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.ValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredValueType), NullabilityState.NotNull)] - [InlineData(nameof(ResourceAttributesInPostRequest.NullableValueType), NullabilityState.Nullable)] - [InlineData(nameof(ResourceAttributesInPostRequest.RequiredNullableValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NonNullableReferenceType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNonNullableReferenceType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableReferenceType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableReferenceType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.ValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredValueType), NullabilityState.NotNull)] + [InlineData(nameof(AttributesInCreateResourceRequest.NullableValueType), NullabilityState.Nullable)] + [InlineData(nameof(AttributesInCreateResourceRequest.RequiredNullableValueType), NullabilityState.NotNull)] public void Nullability_of_generated_attribute_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? property = typeof(ResourceAttributesInPostRequest).GetProperty(propertyName); + PropertyInfo? property = typeof(AttributesInCreateResourceRequest).GetProperty(propertyName); // Assert property.ShouldNotBeNull(); @@ -28,16 +28,16 @@ public void Nullability_of_generated_attribute_property_is_as_expected(string pr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NonNullableToOne), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNonNullableToOne), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.NullableToOne), NullabilityState.Nullable)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredNullableToOne), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.ToMany), NullabilityState.NotNull)] - [InlineData(nameof(ResourceRelationshipsInPostRequest.RequiredToMany), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NonNullableToOne), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNonNullableToOne), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.NullableToOne), NullabilityState.Nullable)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredNullableToOne), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.ToMany), NullabilityState.NotNull)] + [InlineData(nameof(RelationshipsInCreateResourceRequest.RequiredToMany), NullabilityState.NotNull)] public void Nullability_of_generated_relationship_property_is_as_expected(string propertyName, NullabilityState expectedState) { // Act - PropertyInfo? relationshipProperty = typeof(ResourceRelationshipsInPostRequest).GetProperty(propertyName); + PropertyInfo? relationshipProperty = typeof(RelationshipsInCreateResourceRequest).GetProperty(propertyName); // Assert relationshipProperty.ShouldNotBeNull(); diff --git a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs index ea057f1b79..b38b594ebc 100644 --- a/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs +++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs @@ -18,12 +18,12 @@ public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests public async Task Cannot_omit_Id() { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -48,24 +48,24 @@ public async Task Cannot_omit_Id() } [Theory] - [InlineData(nameof(ResourceAttributesInPatchRequest.NonNullableReferenceType), "nonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableReferenceType), "nullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.ValueType), "valueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredValueType), "requiredValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.NullableValueType), "nullableValueType")] - [InlineData(nameof(ResourceAttributesInPatchRequest.RequiredNullableValueType), "requiredNullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NonNullableReferenceType), "nonNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNonNullableReferenceType), "requiredNonNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableReferenceType), "nullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableReferenceType), "requiredNullableReferenceType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.ValueType), "valueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredValueType), "requiredValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.NullableValueType), "nullableValueType")] + [InlineData(nameof(AttributesInUpdateResourceRequest.RequiredNullableValueType), "requiredNullableValueType")] public async Task Can_omit_attribute(string attributePropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), @@ -82,7 +82,7 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null); var apiClient = new NrtOnMsvOnClient(wrapper.HttpClient); - using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); + using IDisposable _ = apiClient.WithPartialAttributeSerialization(requestDocument); // Act await ApiResponse.TranslateAsync(async () => await apiClient.PatchResourceAsync(requestDocument.Data.Id, null, requestDocument)); @@ -97,22 +97,22 @@ public async Task Can_omit_attribute(string attributePropertyName, string jsonPr } [Theory] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.NonNullableToOne), "nonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.NullableToOne), "nullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredNullableToOne), "requiredNullableToOne")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.ToMany), "toMany")] - [InlineData(nameof(ResourceRelationshipsInPatchRequest.RequiredToMany), "requiredToMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.NonNullableToOne), "nonNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredNonNullableToOne), "requiredNonNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.NullableToOne), "nullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredNullableToOne), "requiredNullableToOne")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.ToMany), "toMany")] + [InlineData(nameof(RelationshipsInUpdateResourceRequest.RequiredToMany), "requiredToMany")] public async Task Can_omit_relationship(string relationshipPropertyName, string jsonPropertyName) { // Arrange - var requestDocument = new ResourcePatchRequestDocument + var requestDocument = new UpdateResourceRequestDocument { - Data = new ResourceDataInPatchRequest + Data = new DataInUpdateResourceRequest { Id = Unknown.StringId.Int32, Attributes = _fakers.PatchAttributes.Generate(), - Relationships = new ResourceRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateResourceRequest { NonNullableToOne = _fakers.ToOne.Generate(), RequiredNonNullableToOne = _fakers.ToOne.Generate(), diff --git a/test/OpenApiNSwagEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs b/test/OpenApiNSwagEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs index 30caacafd6..9fbe7aa707 100644 --- a/test/OpenApiNSwagEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs +++ b/test/OpenApiNSwagEndToEndTests/ClientIdGenerationModes/ClientIdGenerationModesTests.cs @@ -39,11 +39,11 @@ public async Task Cannot_create_resource_without_ID_when_supplying_ID_is_require using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new PlayerPostRequestDocument + var requestBody = new CreatePlayerRequestDocument { - Data = new PlayerDataInPostRequest + Data = new DataInCreatePlayerRequest { - Attributes = new PlayerAttributesInPostRequest + Attributes = new AttributesInCreatePlayerRequest { UserName = newPlayer.UserName } @@ -68,12 +68,12 @@ public async Task Can_create_resource_with_ID_when_supplying_ID_is_required() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new PlayerPostRequestDocument + var requestBody = new CreatePlayerRequestDocument { - Data = new PlayerDataInPostRequest + Data = new DataInCreatePlayerRequest { Id = newPlayer.StringId!, - Attributes = new PlayerAttributesInPostRequest + Attributes = new AttributesInCreatePlayerRequest { UserName = newPlayer.UserName } @@ -103,11 +103,11 @@ public async Task Can_create_resource_without_ID_when_supplying_ID_is_allowed() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = newGame.Title, PurchasePrice = (double)newGame.PurchasePrice @@ -143,12 +143,12 @@ public async Task Can_create_resource_with_ID_when_supplying_ID_is_allowed() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { Id = newGame.StringId!, - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = newGame.Title, PurchasePrice = (double)newGame.PurchasePrice @@ -186,12 +186,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new GamePostRequestDocument + var requestBody = new CreateGameRequestDocument { - Data = new GameDataInPostRequest + Data = new DataInCreateGameRequest { Id = existingGame.StringId!, - Attributes = new GameAttributesInPostRequest + Attributes = new AttributesInCreateGameRequest { Title = existingGame.Title, PurchasePrice = (double)existingGame.PurchasePrice @@ -223,11 +223,11 @@ public async Task Can_create_resource_without_ID_when_supplying_ID_is_forbidden( using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ClientIdGenerationModesClient apiClient = new(httpClient); - var requestBody = new PlayerGroupPostRequestDocument + var requestBody = new CreatePlayerGroupRequestDocument { - Data = new PlayerGroupDataInPostRequest + Data = new DataInCreatePlayerGroupRequest { - Attributes = new PlayerGroupAttributesInPostRequest + Attributes = new AttributesInCreatePlayerGroupRequest { Name = newPlayerGroup.Name } diff --git a/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs index 0df55f14f0..b1f47a334a 100644 --- a/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs +++ b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs @@ -116,11 +116,11 @@ public async Task Returns_no_ETag_for_POST_request() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new HeadersClient(httpClient); - var requestBody = new CountryPostRequestDocument + var requestBody = new CreateCountryRequestDocument { - Data = new CountryDataInPostRequest + Data = new DataInCreateCountryRequest { - Attributes = new CountryAttributesInPostRequest + Attributes = new AttributesInCreateCountryRequest { Name = newCountry.Name, Population = newCountry.Population diff --git a/test/OpenApiNSwagEndToEndTests/Headers/HeaderTests.cs b/test/OpenApiNSwagEndToEndTests/Headers/HeaderTests.cs index 3c928c1853..209d4da36c 100644 --- a/test/OpenApiNSwagEndToEndTests/Headers/HeaderTests.cs +++ b/test/OpenApiNSwagEndToEndTests/Headers/HeaderTests.cs @@ -34,11 +34,11 @@ public async Task Returns_Location_for_post_resource_request() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new HeadersClient(httpClient); - var requestBody = new CountryPostRequestDocument + var requestBody = new CreateCountryRequestDocument { - Data = new CountryDataInPostRequest + Data = new DataInCreateCountryRequest { - Attributes = new CountryAttributesInPostRequest + Attributes = new AttributesInCreateCountryRequest { Name = newCountry.Name, Population = newCountry.Population diff --git a/test/OpenApiNSwagEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs b/test/OpenApiNSwagEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs index 7f91408a67..80ca576c83 100644 --- a/test/OpenApiNSwagEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/OpenApiNSwagEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs @@ -41,11 +41,11 @@ public async Task Cannot_exceed_length_constraint(string firstName) using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { FirstName = firstName, LastName = newAccount.LastName @@ -78,11 +78,11 @@ public async Task Cannot_exceed_string_length_constraint(string userName) using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, UserName = userName @@ -113,11 +113,11 @@ public async Task Cannot_violate_regular_expression_constraint() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, UserName = "aB1" @@ -148,11 +148,11 @@ public async Task Cannot_use_invalid_credit_card_number() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, CreditCard = "123-456" @@ -183,11 +183,11 @@ public async Task Cannot_use_invalid_email_address() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Email = "abc" @@ -218,12 +218,12 @@ public async Task Cannot_exceed_min_length_constraint() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, // Using -3 instead of -1 to compensate for base64 padding. @@ -257,12 +257,12 @@ public async Task Cannot_exceed_max_length_constraint() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { Type = SocialMediaAccountResourceType.SocialMediaAccounts, - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Password = Enumerable.Repeat((byte)'X', SocialMediaAccount.MaxPasswordChars + 1).ToArray() @@ -299,11 +299,11 @@ public async Task Cannot_use_double_outside_of_valid_range(double age) using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Age = age @@ -334,11 +334,11 @@ public async Task Cannot_use_relative_url() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, BackgroundPicture = new Uri("relativeurl", UriKind.Relative) @@ -371,11 +371,11 @@ public async Task Cannot_exceed_collection_length_constraint(int length) using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Tags = Enumerable.Repeat("-", length).ToList() @@ -406,11 +406,11 @@ public async Task Cannot_use_non_allowed_value() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, CountryCode = "XX" @@ -441,11 +441,11 @@ public async Task Cannot_use_denied_value() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, Planet = "pluto" @@ -476,11 +476,11 @@ public async Task Cannot_use_TimeSpan_outside_of_valid_range() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { LastName = newAccount.LastName, NextRevalidation = TimeSpan.FromSeconds(1).ToString() @@ -511,11 +511,11 @@ public async Task Can_create_resource_with_valid_properties() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); ModelStateValidationClient apiClient = new(httpClient); - SocialMediaAccountPostRequestDocument requestBody = new() + var requestBody = new CreateSocialMediaAccountRequestDocument { - Data = new SocialMediaAccountDataInPostRequest + Data = new DataInCreateSocialMediaAccountRequest { - Attributes = new SocialMediaAccountAttributesInPostRequest + Attributes = new AttributesInCreateSocialMediaAccountRequest { AlternativeId = newAccount.AlternativeId, FirstName = newAccount.FirstName, diff --git a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs index 0a7c8acf1a..30b57de06b 100644 --- a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs +++ b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs @@ -43,16 +43,16 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - var requestBody = new WriteOnlyChannelPostRequestDocument + var requestBody = new CreateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPostRequest + Data = new DataInCreateWriteOnlyChannelRequest { - Attributes = new WriteOnlyChannelAttributesInPostRequest + Attributes = new AttributesInCreateWriteOnlyChannelRequest { Name = newChannel.Name, IsAdultOnly = newChannel.IsAdultOnly }, - Relationships = new WriteOnlyChannelRelationshipsInPostRequest + Relationships = new RelationshipsInCreateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { @@ -139,7 +139,7 @@ public async Task Cannot_create_resource_for_missing_request_body() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - WriteOnlyChannelPostRequestDocument requestBody = null!; + CreateWriteOnlyChannelRequestDocument requestBody = null!; // Act Func action = async () => _ = await apiClient.PostWriteOnlyChannelAsync(null, requestBody); @@ -159,15 +159,15 @@ public async Task Cannot_create_resource_with_unknown_relationship_ID() using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - var requestBody = new WriteOnlyChannelPostRequestDocument + var requestBody = new CreateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPostRequest + Data = new DataInCreateWriteOnlyChannelRequest { - Attributes = new WriteOnlyChannelAttributesInPostRequest + Attributes = new AttributesInCreateWriteOnlyChannelRequest { Name = newChannel.Name }, - Relationships = new WriteOnlyChannelRelationshipsInPostRequest + Relationships = new RelationshipsInCreateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { diff --git a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs index cde8b0413d..cf8b1c62f0 100644 --- a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs +++ b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs @@ -52,16 +52,16 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Id = existingChannel.StringId!, - Attributes = new WriteOnlyChannelAttributesInPatchRequest + Attributes = new AttributesInUpdateWriteOnlyChannelRequest { Name = newChannelName }, - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { @@ -153,13 +153,13 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Id = existingChannel.StringId!, - Attributes = new WriteOnlyChannelAttributesInPatchRequest(), - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest() + Attributes = new AttributesInUpdateWriteOnlyChannelRequest(), + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest() } }; @@ -221,7 +221,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - WriteOnlyChannelPatchRequestDocument requestBody = null!; + UpdateWriteOnlyChannelRequestDocument requestBody = null!; // Act Func action = async () => _ = await apiClient.PatchWriteOnlyChannelAsync(existingChannel.StringId!, null, requestBody); @@ -248,12 +248,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); var apiClient = new RestrictedControllersClient(httpClient); - var requestBody = new WriteOnlyChannelPatchRequestDocument + var requestBody = new UpdateWriteOnlyChannelRequestDocument { - Data = new WriteOnlyChannelDataInPatchRequest + Data = new DataInUpdateWriteOnlyChannelRequest { Id = existingChannel.StringId!, - Relationships = new WriteOnlyChannelRelationshipsInPatchRequest + Relationships = new RelationshipsInUpdateWriteOnlyChannelRequest { VideoStream = new ToOneDataStreamInRequest { diff --git a/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs b/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs index 0550083c2f..34140cb882 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs +++ b/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs @@ -26,7 +26,7 @@ public async Task Schema_property_for_ID_is_required_in_post_request() JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.playerDataInPostRequest").With(dataElement => + document.Should().ContainPath("components.schemas.dataInCreatePlayerRequest").With(dataElement => { dataElement.Should().ContainPath("required").With(requiredElement => { @@ -44,7 +44,7 @@ public async Task Schema_property_for_ID_is_optional_in_post_request() JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.gameDataInPostRequest").With(dataElement => + document.Should().ContainPath("components.schemas.dataInCreateGameRequest").With(dataElement => { dataElement.Should().ContainPath("required").With(requiredElement => { @@ -62,7 +62,7 @@ public async Task Schema_property_for_ID_is_omitted_in_post_request() JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.playerGroupDataInPostRequest").With(dataElement => + document.Should().ContainPath("components.schemas.dataInCreatePlayerGroupRequest").With(dataElement => { dataElement.Should().ContainPath("required").With(requiredElement => { diff --git a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json index 24680ef3a9..70a6d86b27 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json @@ -39,7 +39,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/gamePostRequestDocument" + "$ref": "#/components/schemas/createGameRequestDocument" } ] } @@ -143,7 +143,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/playerGroupPostRequestDocument" + "$ref": "#/components/schemas/createPlayerGroupRequestDocument" } ] } @@ -257,7 +257,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/playerPostRequestDocument" + "$ref": "#/components/schemas/createPlayerRequestDocument" } ] } @@ -335,6 +335,174 @@ }, "components": { "schemas": { + "attributesInCreateGameRequest": { + "required": [ + "title" + ], + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "purchasePrice": { + "type": "number", + "format": "double" + } + }, + "additionalProperties": false + }, + "attributesInCreatePlayerGroupRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "attributesInCreatePlayerRequest": { + "required": [ + "userName" + ], + "type": "object", + "properties": { + "userName": { + "type": "string" + } + }, + "additionalProperties": false + }, + "createGameRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateGameRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createPlayerGroupRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreatePlayerGroupRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createPlayerRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreatePlayerRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateGameRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/gameResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateGameRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreatePlayerGroupRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/playerGroupResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreatePlayerGroupRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreatePlayerGroupRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreatePlayerRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/playerResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreatePlayerRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreatePlayerRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -482,22 +650,6 @@ }, "additionalProperties": false }, - "gameAttributesInPostRequest": { - "required": [ - "title" - ], - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "purchasePrice": { - "type": "number", - "format": "double" - } - }, - "additionalProperties": false - }, "gameAttributesInResponse": { "type": "object", "properties": { @@ -511,29 +663,6 @@ }, "additionalProperties": false }, - "gameDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/gameResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/gameAttributesInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "gameDataInResponse": { "allOf": [ { @@ -586,22 +715,6 @@ }, "additionalProperties": false }, - "gamePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/gameDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "gamePrimaryResponseDocument": { "required": [ "data", @@ -646,18 +759,6 @@ "type": "string", "additionalProperties": false }, - "playerAttributesInPostRequest": { - "required": [ - "userName" - ], - "type": "object", - "properties": { - "userName": { - "type": "string" - } - }, - "additionalProperties": false - }, "playerAttributesInResponse": { "type": "object", "properties": { @@ -667,37 +768,6 @@ }, "additionalProperties": false }, - "playerDataInPostRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/playerResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/playerAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/playerRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerDataInResponse": { "allOf": [ { @@ -740,18 +810,6 @@ ], "additionalProperties": false }, - "playerGroupAttributesInPostRequest": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "additionalProperties": false - }, "playerGroupAttributesInResponse": { "type": "object", "properties": { @@ -761,32 +819,6 @@ }, "additionalProperties": false }, - "playerGroupDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/playerGroupResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/playerGroupAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/playerGroupRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerGroupDataInResponse": { "allOf": [ { @@ -846,22 +878,6 @@ }, "additionalProperties": false }, - "playerGroupPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/playerGroupDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerGroupPrimaryResponseDocument": { "required": [ "data", @@ -899,19 +915,6 @@ }, "additionalProperties": false }, - "playerGroupRelationshipsInPostRequest": { - "type": "object", - "properties": { - "players": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyPlayerInRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerGroupRelationshipsInResponse": { "type": "object", "properties": { @@ -949,22 +952,6 @@ }, "additionalProperties": false }, - "playerPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/playerDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerPrimaryResponseDocument": { "required": [ "data", @@ -1002,26 +989,6 @@ }, "additionalProperties": false }, - "playerRelationshipsInPostRequest": { - "type": "object", - "properties": { - "ownedGames": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyGameInRequest" - } - ] - }, - "memberOf": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyPlayerGroupInRequest" - } - ] - } - }, - "additionalProperties": false - }, "playerRelationshipsInResponse": { "type": "object", "properties": { @@ -1061,6 +1028,39 @@ }, "additionalProperties": false }, + "relationshipsInCreatePlayerGroupRequest": { + "type": "object", + "properties": { + "players": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyPlayerInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreatePlayerRequest": { + "type": "object", + "properties": { + "ownedGames": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyGameInRequest" + } + ] + }, + "memberOf": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyPlayerGroupInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceLinks": { "type": "object", "properties": { diff --git a/test/OpenApiTests/Documentation/DocumentationTests.cs b/test/OpenApiTests/Documentation/DocumentationTests.cs index 9a254968e7..aea6da87ed 100644 --- a/test/OpenApiTests/Documentation/DocumentationTests.cs +++ b/test/OpenApiTests/Documentation/DocumentationTests.cs @@ -591,16 +591,16 @@ public async Task Resource_types_are_documented() // Assert document.Should().ContainPath("components.schemas").With(schemasElement => { - schemasElement.Should().HaveProperty("elevatorDataInPatchRequest.description", "An elevator within a skyscraper."); - schemasElement.Should().HaveProperty("elevatorDataInPostRequest.description", "An elevator within a skyscraper."); + schemasElement.Should().HaveProperty("dataInUpdateElevatorRequest.description", "An elevator within a skyscraper."); + schemasElement.Should().HaveProperty("dataInCreateElevatorRequest.description", "An elevator within a skyscraper."); schemasElement.Should().HaveProperty("elevatorDataInResponse.description", "An elevator within a skyscraper."); - schemasElement.Should().HaveProperty("skyscraperDataInPatchRequest.description", "A tall, continuously habitable building having multiple floors."); - schemasElement.Should().HaveProperty("skyscraperDataInPostRequest.description", "A tall, continuously habitable building having multiple floors."); + schemasElement.Should().HaveProperty("dataInUpdateSkyscraperRequest.description", "A tall, continuously habitable building having multiple floors."); + schemasElement.Should().HaveProperty("dataInCreateSkyscraperRequest.description", "A tall, continuously habitable building having multiple floors."); schemasElement.Should().HaveProperty("skyscraperDataInResponse.description", "A tall, continuously habitable building having multiple floors."); - schemasElement.Should().HaveProperty("spaceDataInPatchRequest.description", "A space within a skyscraper, such as an office, hotel, residential space, or retail space."); - schemasElement.Should().HaveProperty("spaceDataInPostRequest.description", "A space within a skyscraper, such as an office, hotel, residential space, or retail space."); + schemasElement.Should().HaveProperty("dataInUpdateSpaceRequest.description", "A space within a skyscraper, such as an office, hotel, residential space, or retail space."); + schemasElement.Should().HaveProperty("dataInCreateSpaceRequest.description", "A space within a skyscraper, such as an office, hotel, residential space, or retail space."); schemasElement.Should().HaveProperty("spaceDataInResponse.description", "A space within a skyscraper, such as an office, hotel, residential space, or retail space."); }); } @@ -614,21 +614,21 @@ public async Task Attributes_are_documented() // Assert document.Should().ContainPath("components.schemas").With(schemasElement => { - schemasElement.Should().HaveProperty("elevatorAttributesInPatchRequest.properties.floorCount.description", "The number of floors this elevator provides access to."); - schemasElement.Should().HaveProperty("elevatorAttributesInPostRequest.properties.floorCount.description", "The number of floors this elevator provides access to."); + schemasElement.Should().HaveProperty("attributesInUpdateElevatorRequest.properties.floorCount.description", "The number of floors this elevator provides access to."); + schemasElement.Should().HaveProperty("attributesInCreateElevatorRequest.properties.floorCount.description", "The number of floors this elevator provides access to."); schemasElement.Should().HaveProperty("elevatorAttributesInResponse.properties.floorCount.description", "The number of floors this elevator provides access to."); - schemasElement.Should().HaveProperty("skyscraperAttributesInPatchRequest.properties.heightInMeters.description", "The height of this building, in meters."); - schemasElement.Should().HaveProperty("skyscraperAttributesInPostRequest.properties.heightInMeters.description", "The height of this building, in meters."); + schemasElement.Should().HaveProperty("attributesInUpdateSkyscraperRequest.properties.heightInMeters.description", "The height of this building, in meters."); + schemasElement.Should().HaveProperty("attributesInCreateSkyscraperRequest.properties.heightInMeters.description", "The height of this building, in meters."); schemasElement.Should().HaveProperty("skyscraperAttributesInResponse.properties.heightInMeters.description", "The height of this building, in meters."); - schemasElement.Should().ContainPath("spaceAttributesInPatchRequest.properties").With(propertiesElement => + schemasElement.Should().ContainPath("attributesInUpdateSpaceRequest.properties").With(propertiesElement => { propertiesElement.Should().HaveProperty("floorNumber.description", "The floor number on which this space resides."); propertiesElement.Should().HaveProperty("kind.description", "The kind of this space."); }); - schemasElement.Should().ContainPath("spaceAttributesInPostRequest.properties").With(propertiesElement => + schemasElement.Should().ContainPath("attributesInCreateSpaceRequest.properties").With(propertiesElement => { propertiesElement.Should().HaveProperty("floorNumber.description", "The floor number on which this space resides."); propertiesElement.Should().HaveProperty("kind.description", "The kind of this space."); @@ -651,17 +651,17 @@ public async Task Relationships_are_documented() // Assert document.Should().ContainPath("components.schemas").With(schemasElement => { - schemasElement.Should().HaveProperty("elevatorRelationshipsInPatchRequest.properties.existsIn.description", "The skyscraper this elevator exists in."); - schemasElement.Should().HaveProperty("elevatorRelationshipsInPostRequest.properties.existsIn.description", "The skyscraper this elevator exists in."); + schemasElement.Should().HaveProperty("relationshipsInUpdateElevatorRequest.properties.existsIn.description", "The skyscraper this elevator exists in."); + schemasElement.Should().HaveProperty("relationshipsInCreateElevatorRequest.properties.existsIn.description", "The skyscraper this elevator exists in."); schemasElement.Should().HaveProperty("elevatorRelationshipsInResponse.properties.existsIn.description", "The skyscraper this elevator exists in."); - schemasElement.Should().ContainPath("skyscraperRelationshipsInPatchRequest.properties").With(propertiesElement => + schemasElement.Should().ContainPath("relationshipsInUpdateSkyscraperRequest.properties").With(propertiesElement => { propertiesElement.Should().HaveProperty("elevator.description", "An optional elevator within this building, providing access to spaces."); propertiesElement.Should().HaveProperty("spaces.description", "The spaces within this building."); }); - schemasElement.Should().ContainPath("skyscraperRelationshipsInPostRequest.properties").With(propertiesElement => + schemasElement.Should().ContainPath("relationshipsInCreateSkyscraperRequest.properties").With(propertiesElement => { propertiesElement.Should().HaveProperty("elevator.description", "An optional elevator within this building, providing access to spaces."); propertiesElement.Should().HaveProperty("spaces.description", "The spaces within this building."); @@ -673,8 +673,8 @@ public async Task Relationships_are_documented() propertiesElement.Should().HaveProperty("spaces.description", "The spaces within this building."); }); - schemasElement.Should().HaveProperty("spaceRelationshipsInPatchRequest.properties.existsIn.description", "The skyscraper this space exists in."); - schemasElement.Should().HaveProperty("spaceRelationshipsInPostRequest.properties.existsIn.description", "The skyscraper this space exists in."); + schemasElement.Should().HaveProperty("relationshipsInUpdateSpaceRequest.properties.existsIn.description", "The skyscraper this space exists in."); + schemasElement.Should().HaveProperty("relationshipsInCreateSpaceRequest.properties.existsIn.description", "The skyscraper this space exists in."); schemasElement.Should().HaveProperty("spaceRelationshipsInResponse.properties.existsIn.description", "The skyscraper this space exists in."); }); } diff --git a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json index c8e1735b6b..afa2ecbff0 100644 --- a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/countryPostRequestDocument" + "$ref": "#/components/schemas/createCountryRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/countryPatchRequestDocument" + "$ref": "#/components/schemas/updateCountryRequestDocument" } ] } @@ -1128,7 +1128,10 @@ }, "components": { "schemas": { - "countryAttributesInPatchRequest": { + "attributesInCreateCountryRequest": { + "required": [ + "name" + ], "type": "object", "properties": { "name": { @@ -1141,10 +1144,7 @@ }, "additionalProperties": false }, - "countryAttributesInPostRequest": { - "required": [ - "name" - ], + "attributesInUpdateCountryRequest": { "type": "object", "properties": { "name": { @@ -1206,63 +1206,6 @@ }, "additionalProperties": false }, - "countryDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/countryResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/countryAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/countryRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "countryDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/countryResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/countryAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/countryRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "countryDataInResponse": { "allOf": [ { @@ -1305,38 +1248,6 @@ ], "additionalProperties": false }, - "countryPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/countryDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "countryPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/countryDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "countryPrimaryResponseDocument": { "required": [ "data", @@ -1374,52 +1285,68 @@ }, "additionalProperties": false }, - "countryRelationshipsInPatchRequest": { + "countryRelationshipsInResponse": { "type": "object", "properties": { "languages": { "allOf": [ { - "$ref": "#/components/schemas/toManyLanguageInRequest" + "$ref": "#/components/schemas/toManyLanguageInResponse" } ] } }, "additionalProperties": false }, - "countryRelationshipsInPostRequest": { + "countryResourceType": { + "enum": [ + "countries" + ], + "type": "string", + "additionalProperties": false + }, + "createCountryRequestDocument": { + "required": [ + "data" + ], "type": "object", "properties": { - "languages": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/toManyLanguageInRequest" + "$ref": "#/components/schemas/dataInCreateCountryRequest" } ] } }, "additionalProperties": false }, - "countryRelationshipsInResponse": { + "dataInCreateCountryRequest": { + "required": [ + "type" + ], "type": "object", "properties": { - "languages": { + "type": { + "$ref": "#/components/schemas/countryResourceType" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/toManyLanguageInResponse" + "$ref": "#/components/schemas/attributesInCreateCountryRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateCountryRequest" } ] } }, "additionalProperties": false }, - "countryResourceType": { - "enum": [ - "countries" - ], - "type": "string", - "additionalProperties": false - }, "dataInResponse": { "required": [ "id", @@ -1446,6 +1373,37 @@ }, "x-abstract": true }, + "dataInUpdateCountryRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/countryResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateCountryRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateCountryRequest" + } + ] + } + }, + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -1715,6 +1673,32 @@ }, "additionalProperties": false }, + "relationshipsInCreateCountryRequest": { + "type": "object", + "properties": { + "languages": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyLanguageInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateCountryRequest": { + "type": "object", + "properties": { + "languages": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyLanguageInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -1827,6 +1811,22 @@ } }, "additionalProperties": false + }, + "updateCountryRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateCountryRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json index 2112a1cf5c..2f4d796e38 100644 --- a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/airplane-post-request-document" + "$ref": "#/components/schemas/create-airplane-request-document" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/airplane-patch-request-document" + "$ref": "#/components/schemas/update-airplane-request-document" } ] } @@ -1295,7 +1295,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-post-request-document" + "$ref": "#/components/schemas/create-flight-attendant-request-document" } ] } @@ -1590,7 +1590,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-patch-request-document" + "$ref": "#/components/schemas/update-flight-attendant-request-document" } ] } @@ -2962,7 +2962,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-post-request-document" + "$ref": "#/components/schemas/create-flight-request-document" } ] } @@ -3257,7 +3257,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-patch-request-document" + "$ref": "#/components/schemas/update-flight-request-document" } ] } @@ -5461,7 +5461,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/passenger-post-request-document" + "$ref": "#/components/schemas/create-passenger-request-document" } ] } @@ -5756,7 +5756,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/passenger-patch-request-document" + "$ref": "#/components/schemas/update-passenger-request-document" } ] } @@ -5875,7 +5875,7 @@ "type": "string", "description": "Lists the various airlines used in this API." }, - "airplane-attributes-in-patch-request": { + "airplane-attributes-in-response": { "type": "object", "properties": { "name": { @@ -5897,6 +5897,11 @@ "format": "date-time", "nullable": true }, + "manufactured-at": { + "type": "string", + "description": "Gets the day on which this airplane was manufactured.", + "format": "date-time" + }, "is-in-maintenance": { "type": "boolean" }, @@ -5904,11 +5909,167 @@ "maxLength": 85, "type": "string", "nullable": true + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/aircraft-kind" + } + ] } }, "additionalProperties": false }, - "airplane-attributes-in-post-request": { + "airplane-collection-response-document": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-collection-top-level-links" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/airplane-data-in-response" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/data-in-response" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "airplane-data-in-response": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-response" + }, + { + "type": "object", + "properties": { + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-attributes-in-response" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-relationships-in-response" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-links" + } + ] + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "airplane-primary-response-document": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-top-level-links" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-data-in-response" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/data-in-response" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "airplane-relationships-in-response": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-response" + } + ] + } + }, + "additionalProperties": false + }, + "airplane-resource-type": { + "enum": [ + "airplanes" + ], + "type": "string", + "additionalProperties": false + }, + "attributes-in-create-airplane-request": { "required": [ "name" ], @@ -5936,7 +6097,45 @@ }, "additionalProperties": false }, - "airplane-attributes-in-response": { + "attributes-in-create-flight-attendant-request": { + "required": [ + "email-address", + "profile-image-url" + ], + "type": "object", + "properties": { + "email-address": { + "minLength": 1, + "type": "string", + "format": "email" + }, + "age": { + "maximum": 75, + "minimum": 18, + "type": "integer", + "format": "int32" + }, + "profile-image-url": { + "type": "string", + "format": "uri" + } + }, + "additionalProperties": false + }, + "attributes-in-create-passenger-request": { + "required": [ + "document-number" + ], + "type": "object", + "properties": { + "document-number": { + "maxLength": 9, + "type": "string" + } + }, + "additionalProperties": false + }, + "attributes-in-update-airplane-request": { "type": "object", "properties": { "name": { @@ -5958,11 +6157,6 @@ "format": "date-time", "nullable": true }, - "manufactured-at": { - "type": "string", - "description": "Gets the day on which this airplane was manufactured.", - "format": "date-time" - }, "is-in-maintenance": { "type": "boolean" }, @@ -5970,63 +6164,133 @@ "maxLength": 85, "type": "string", "nullable": true + } + }, + "additionalProperties": false + }, + "attributes-in-update-flight-attendant-request": { + "type": "object", + "properties": { + "email-address": { + "minLength": 1, + "type": "string", + "format": "email" }, - "kind": { + "age": { + "maximum": 75, + "minimum": 18, + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributes-in-update-flight-request": { + "type": "object", + "properties": { + "final-destination": { + "maxLength": 40, + "type": "string" + }, + "stop-over-destination": { + "maxLength": 2000, + "type": "string", + "nullable": true + }, + "operated-by": { "allOf": [ { - "$ref": "#/components/schemas/aircraft-kind" + "$ref": "#/components/schemas/airline" } ] } }, "additionalProperties": false }, - "airplane-collection-response-document": { + "attributes-in-update-passenger-request": { + "type": "object", + "properties": { + "document-number": { + "maxLength": 9, + "type": "string" + } + }, + "additionalProperties": false + }, + "cabin-area": { + "enum": [ + "FirstClass", + "BusinessClass", + "EconomyClass" + ], + "type": "string" + }, + "create-airplane-request-document": { "required": [ - "data", - "links" + "data" ], "type": "object", "properties": { - "jsonapi": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/jsonapi" + "$ref": "#/components/schemas/data-in-create-airplane-request" } ] - }, - "links": { + } + }, + "additionalProperties": false + }, + "create-flight-attendant-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/resource-collection-top-level-links" + "$ref": "#/components/schemas/data-in-create-flight-attendant-request" } ] - }, + } + }, + "additionalProperties": false + }, + "create-flight-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/airplane-data-in-response" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/data-in-response" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-flight-request" + } + ] } }, "additionalProperties": false }, - "airplane-data-in-patch-request": { + "create-passenger-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-passenger-request" + } + ] + } + }, + "additionalProperties": false + }, + "data-in-create-airplane-request": { "required": [ - "id", "type" ], "type": "object", @@ -6034,226 +6298,209 @@ "type": { "$ref": "#/components/schemas/airplane-resource-type" }, - "id": { - "minLength": 1, - "type": "string" - }, "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-attributes-in-patch-request" + "$ref": "#/components/schemas/attributes-in-create-airplane-request" } ] }, "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-relationships-in-patch-request" + "$ref": "#/components/schemas/relationships-in-create-airplane-request" } ] } }, "additionalProperties": false }, - "airplane-data-in-post-request": { + "data-in-create-flight-attendant-request": { "required": [ "type" ], "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "$ref": "#/components/schemas/flight-attendant-resource-type" }, "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-attributes-in-post-request" + "$ref": "#/components/schemas/attributes-in-create-flight-attendant-request" } ] }, "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-relationships-in-post-request" + "$ref": "#/components/schemas/relationships-in-create-flight-attendant-request" } ] } - }, - "additionalProperties": false - }, - "airplane-data-in-response": { - "allOf": [ - { - "$ref": "#/components/schemas/data-in-response" - }, - { - "type": "object", - "properties": { - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/airplane-attributes-in-response" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/airplane-relationships-in-response" - } - ] - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resource-links" - } - ] - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - } - ], + }, "additionalProperties": false }, - "airplane-patch-request-document": { + "data-in-create-flight-request": { "required": [ - "data" + "type" ], "type": "object", "properties": { - "data": { + "type": { + "$ref": "#/components/schemas/flight-resource-type" + }, + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-patch-request" + "$ref": "#/components/schemas/relationships-in-create-flight-request" } ] } }, "additionalProperties": false }, - "airplane-post-request-document": { + "data-in-create-passenger-request": { "required": [ - "data" + "type" ], "type": "object", "properties": { - "data": { + "type": { + "$ref": "#/components/schemas/passenger-resource-type" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-post-request" + "$ref": "#/components/schemas/attributes-in-create-passenger-request" } ] } }, "additionalProperties": false }, - "airplane-primary-response-document": { + "data-in-response": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "jsonapi": { - "allOf": [ - { - "$ref": "#/components/schemas/jsonapi" - } - ] + "type": { + "minLength": 1, + "type": "string" }, - "links": { + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "airplanes": "#/components/schemas/airplane-data-in-response", + "flight-attendants": "#/components/schemas/flight-attendant-data-in-response", + "flights": "#/components/schemas/flight-data-in-response", + "passengers": "#/components/schemas/passenger-data-in-response" + } + }, + "x-abstract": true + }, + "data-in-update-airplane-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/airplane-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/resource-top-level-links" + "$ref": "#/components/schemas/attributes-in-update-airplane-request" } ] }, - "data": { + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-response" + "$ref": "#/components/schemas/relationships-in-update-airplane-request" } ] - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/data-in-response" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } } }, "additionalProperties": false }, - "airplane-relationships-in-patch-request": { + "data-in-update-flight-attendant-request": { + "required": [ + "id", + "type" + ], "type": "object", "properties": { - "flights": { + "type": { + "$ref": "#/components/schemas/flight-attendant-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-request" + "$ref": "#/components/schemas/attributes-in-update-flight-attendant-request" } ] - } - }, - "additionalProperties": false - }, - "airplane-relationships-in-post-request": { - "type": "object", - "properties": { - "flights": { + }, + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-request" + "$ref": "#/components/schemas/relationships-in-update-flight-attendant-request" } ] } }, "additionalProperties": false }, - "airplane-relationships-in-response": { + "data-in-update-flight-request": { + "required": [ + "id", + "type" + ], "type": "object", "properties": { - "flights": { + "type": { + "$ref": "#/components/schemas/flight-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-response" + "$ref": "#/components/schemas/attributes-in-update-flight-request" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationships-in-update-flight-request" } ] } }, "additionalProperties": false }, - "airplane-resource-type": { - "enum": [ - "airplanes" - ], - "type": "string", - "additionalProperties": false - }, - "cabin-area": { - "enum": [ - "FirstClass", - "BusinessClass", - "EconomyClass" - ], - "type": "string" - }, - "data-in-response": { + "data-in-update-passenger-request": { "required": [ "id", "type" @@ -6261,25 +6508,21 @@ "type": "object", "properties": { "type": { - "minLength": 1, - "type": "string" + "$ref": "#/components/schemas/passenger-resource-type" }, "id": { "minLength": 1, "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-update-passenger-request" + } + ] } }, - "additionalProperties": false, - "discriminator": { - "propertyName": "type", - "mapping": { - "airplanes": "#/components/schemas/airplane-data-in-response", - "flight-attendants": "#/components/schemas/flight-attendant-data-in-response", - "flights": "#/components/schemas/flight-data-in-response", - "passengers": "#/components/schemas/passenger-data-in-response" - } - }, - "x-abstract": true + "additionalProperties": false }, "error-links": { "type": "object", @@ -6408,48 +6651,6 @@ }, "additionalProperties": false }, - "flight-attendant-attributes-in-patch-request": { - "type": "object", - "properties": { - "email-address": { - "minLength": 1, - "type": "string", - "format": "email" - }, - "age": { - "maximum": 75, - "minimum": 18, - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "flight-attendant-attributes-in-post-request": { - "required": [ - "email-address", - "profile-image-url" - ], - "type": "object", - "properties": { - "email-address": { - "minLength": 1, - "type": "string", - "format": "email" - }, - "age": { - "maximum": 75, - "minimum": 18, - "type": "integer", - "format": "int32" - }, - "profile-image-url": { - "type": "string", - "format": "uri" - } - }, - "additionalProperties": false - }, "flight-attendant-attributes-in-response": { "type": "object", "properties": { @@ -6510,67 +6711,10 @@ }, "meta": { "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "flight-attendant-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-attributes-in-patch-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-relationships-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-attributes-in-post-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-relationships-in-post-request" - } - ] + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -6709,38 +6853,6 @@ }, "additionalProperties": false }, - "flight-attendant-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-attendant-primary-response-document": { "required": [ "data", @@ -6785,46 +6897,6 @@ }, "additionalProperties": false }, - "flight-attendant-relationships-in-patch-request": { - "type": "object", - "properties": { - "scheduled-for-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - }, - "purser-on-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-relationships-in-post-request": { - "type": "object", - "properties": { - "scheduled-for-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - }, - "purser-on-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-attendant-relationships-in-response": { "type": "object", "properties": { @@ -6896,28 +6968,6 @@ }, "additionalProperties": false }, - "flight-attributes-in-patch-request": { - "type": "object", - "properties": { - "final-destination": { - "maxLength": 40, - "type": "string" - }, - "stop-over-destination": { - "maxLength": 2000, - "type": "string", - "nullable": true - }, - "operated-by": { - "allOf": [ - { - "$ref": "#/components/schemas/airline" - } - ] - } - }, - "additionalProperties": false - }, "flight-attributes-in-response": { "type": "object", "properties": { @@ -6999,56 +7049,6 @@ }, "additionalProperties": false }, - "flight-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attributes-in-patch-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-relationships-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-resource-type" - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-relationships-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-data-in-response": { "allOf": [ { @@ -7145,38 +7145,6 @@ }, "additionalProperties": false }, - "flight-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-primary-response-document": { "required": [ "data", @@ -7221,77 +7189,6 @@ }, "additionalProperties": false }, - "flight-relationships-in-patch-request": { - "type": "object", - "properties": { - "cabin-crew-members": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-attendant-in-request" - } - ] - }, - "purser": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-flight-attendant-in-request" - } - ] - }, - "backup-purser": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" - } - ] - }, - "passengers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-passenger-in-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-relationships-in-post-request": { - "required": [ - "purser" - ], - "type": "object", - "properties": { - "cabin-crew-members": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-attendant-in-request" - } - ] - }, - "purser": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-flight-attendant-in-request" - } - ] - }, - "backup-purser": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" - } - ] - }, - "passengers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-passenger-in-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-relationships-in-response": { "type": "object", "properties": { @@ -7484,31 +7381,8 @@ "type": "object", "additionalProperties": { "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "passenger-attributes-in-patch-request": { - "type": "object", - "properties": { - "document-number": { - "maxLength": 9, - "type": "string" - } - }, - "additionalProperties": false - }, - "passenger-attributes-in-post-request": { - "required": [ - "document-number" - ], - "type": "object", - "properties": { - "document-number": { - "maxLength": 9, - "type": "string" + "nullable": true + } } }, "additionalProperties": false @@ -7573,49 +7447,6 @@ }, "additionalProperties": false }, - "passenger-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/passenger-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-attributes-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "passenger-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/passenger-resource-type" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-attributes-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "passenger-data-in-response": { "allOf": [ { @@ -7705,38 +7536,6 @@ }, "additionalProperties": false }, - "passenger-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "passenger-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "passenger-primary-response-document": { "required": [ "data", @@ -7800,6 +7599,143 @@ }, "additionalProperties": false }, + "relationships-in-create-airplane-request": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-create-flight-attendant-request": { + "type": "object", + "properties": { + "scheduled-for-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + }, + "purser-on-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-create-flight-request": { + "required": [ + "purser" + ], + "type": "object", + "properties": { + "cabin-crew-members": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-attendant-in-request" + } + ] + }, + "purser": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-flight-attendant-in-request" + } + ] + }, + "backup-purser": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" + } + ] + }, + "passengers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-passenger-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-airplane-request": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-flight-attendant-request": { + "type": "object", + "properties": { + "scheduled-for-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + }, + "purser-on-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-flight-request": { + "type": "object", + "properties": { + "cabin-crew-members": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-attendant-in-request" + } + ] + }, + "purser": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-flight-attendant-in-request" + } + ] + }, + "backup-purser": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" + } + ] + }, + "passengers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-passenger-in-request" + } + ] + } + }, + "additionalProperties": false + }, "resource-collection-top-level-links": { "type": "object", "properties": { @@ -8052,6 +7988,70 @@ } }, "additionalProperties": false + }, + "update-airplane-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-airplane-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-flight-attendant-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-flight-attendant-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-flight-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-flight-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-passenger-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-passenger-request" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json index 2112a1cf5c..2f4d796e38 100644 --- a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json +++ b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/airplane-post-request-document" + "$ref": "#/components/schemas/create-airplane-request-document" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/airplane-patch-request-document" + "$ref": "#/components/schemas/update-airplane-request-document" } ] } @@ -1295,7 +1295,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-post-request-document" + "$ref": "#/components/schemas/create-flight-attendant-request-document" } ] } @@ -1590,7 +1590,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-patch-request-document" + "$ref": "#/components/schemas/update-flight-attendant-request-document" } ] } @@ -2962,7 +2962,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-post-request-document" + "$ref": "#/components/schemas/create-flight-request-document" } ] } @@ -3257,7 +3257,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/flight-patch-request-document" + "$ref": "#/components/schemas/update-flight-request-document" } ] } @@ -5461,7 +5461,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/passenger-post-request-document" + "$ref": "#/components/schemas/create-passenger-request-document" } ] } @@ -5756,7 +5756,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/passenger-patch-request-document" + "$ref": "#/components/schemas/update-passenger-request-document" } ] } @@ -5875,7 +5875,7 @@ "type": "string", "description": "Lists the various airlines used in this API." }, - "airplane-attributes-in-patch-request": { + "airplane-attributes-in-response": { "type": "object", "properties": { "name": { @@ -5897,6 +5897,11 @@ "format": "date-time", "nullable": true }, + "manufactured-at": { + "type": "string", + "description": "Gets the day on which this airplane was manufactured.", + "format": "date-time" + }, "is-in-maintenance": { "type": "boolean" }, @@ -5904,11 +5909,167 @@ "maxLength": 85, "type": "string", "nullable": true + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/aircraft-kind" + } + ] } }, "additionalProperties": false }, - "airplane-attributes-in-post-request": { + "airplane-collection-response-document": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-collection-top-level-links" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/airplane-data-in-response" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/data-in-response" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "airplane-data-in-response": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-response" + }, + { + "type": "object", + "properties": { + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-attributes-in-response" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-relationships-in-response" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-links" + } + ] + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "airplane-primary-response-document": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-top-level-links" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/airplane-data-in-response" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/data-in-response" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "airplane-relationships-in-response": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-response" + } + ] + } + }, + "additionalProperties": false + }, + "airplane-resource-type": { + "enum": [ + "airplanes" + ], + "type": "string", + "additionalProperties": false + }, + "attributes-in-create-airplane-request": { "required": [ "name" ], @@ -5936,7 +6097,45 @@ }, "additionalProperties": false }, - "airplane-attributes-in-response": { + "attributes-in-create-flight-attendant-request": { + "required": [ + "email-address", + "profile-image-url" + ], + "type": "object", + "properties": { + "email-address": { + "minLength": 1, + "type": "string", + "format": "email" + }, + "age": { + "maximum": 75, + "minimum": 18, + "type": "integer", + "format": "int32" + }, + "profile-image-url": { + "type": "string", + "format": "uri" + } + }, + "additionalProperties": false + }, + "attributes-in-create-passenger-request": { + "required": [ + "document-number" + ], + "type": "object", + "properties": { + "document-number": { + "maxLength": 9, + "type": "string" + } + }, + "additionalProperties": false + }, + "attributes-in-update-airplane-request": { "type": "object", "properties": { "name": { @@ -5958,11 +6157,6 @@ "format": "date-time", "nullable": true }, - "manufactured-at": { - "type": "string", - "description": "Gets the day on which this airplane was manufactured.", - "format": "date-time" - }, "is-in-maintenance": { "type": "boolean" }, @@ -5970,63 +6164,133 @@ "maxLength": 85, "type": "string", "nullable": true + } + }, + "additionalProperties": false + }, + "attributes-in-update-flight-attendant-request": { + "type": "object", + "properties": { + "email-address": { + "minLength": 1, + "type": "string", + "format": "email" }, - "kind": { + "age": { + "maximum": 75, + "minimum": 18, + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributes-in-update-flight-request": { + "type": "object", + "properties": { + "final-destination": { + "maxLength": 40, + "type": "string" + }, + "stop-over-destination": { + "maxLength": 2000, + "type": "string", + "nullable": true + }, + "operated-by": { "allOf": [ { - "$ref": "#/components/schemas/aircraft-kind" + "$ref": "#/components/schemas/airline" } ] } }, "additionalProperties": false }, - "airplane-collection-response-document": { + "attributes-in-update-passenger-request": { + "type": "object", + "properties": { + "document-number": { + "maxLength": 9, + "type": "string" + } + }, + "additionalProperties": false + }, + "cabin-area": { + "enum": [ + "FirstClass", + "BusinessClass", + "EconomyClass" + ], + "type": "string" + }, + "create-airplane-request-document": { "required": [ - "data", - "links" + "data" ], "type": "object", "properties": { - "jsonapi": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/jsonapi" + "$ref": "#/components/schemas/data-in-create-airplane-request" } ] - }, - "links": { + } + }, + "additionalProperties": false + }, + "create-flight-attendant-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/resource-collection-top-level-links" + "$ref": "#/components/schemas/data-in-create-flight-attendant-request" } ] - }, + } + }, + "additionalProperties": false + }, + "create-flight-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/airplane-data-in-response" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/data-in-response" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-flight-request" + } + ] } }, "additionalProperties": false }, - "airplane-data-in-patch-request": { + "create-passenger-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-passenger-request" + } + ] + } + }, + "additionalProperties": false + }, + "data-in-create-airplane-request": { "required": [ - "id", "type" ], "type": "object", @@ -6034,226 +6298,209 @@ "type": { "$ref": "#/components/schemas/airplane-resource-type" }, - "id": { - "minLength": 1, - "type": "string" - }, "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-attributes-in-patch-request" + "$ref": "#/components/schemas/attributes-in-create-airplane-request" } ] }, "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-relationships-in-patch-request" + "$ref": "#/components/schemas/relationships-in-create-airplane-request" } ] } }, "additionalProperties": false }, - "airplane-data-in-post-request": { + "data-in-create-flight-attendant-request": { "required": [ "type" ], "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "$ref": "#/components/schemas/flight-attendant-resource-type" }, "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-attributes-in-post-request" + "$ref": "#/components/schemas/attributes-in-create-flight-attendant-request" } ] }, "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-relationships-in-post-request" + "$ref": "#/components/schemas/relationships-in-create-flight-attendant-request" } ] } - }, - "additionalProperties": false - }, - "airplane-data-in-response": { - "allOf": [ - { - "$ref": "#/components/schemas/data-in-response" - }, - { - "type": "object", - "properties": { - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/airplane-attributes-in-response" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/airplane-relationships-in-response" - } - ] - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resource-links" - } - ] - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - } - ], + }, "additionalProperties": false }, - "airplane-patch-request-document": { + "data-in-create-flight-request": { "required": [ - "data" + "type" ], "type": "object", "properties": { - "data": { + "type": { + "$ref": "#/components/schemas/flight-resource-type" + }, + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-patch-request" + "$ref": "#/components/schemas/relationships-in-create-flight-request" } ] } }, "additionalProperties": false }, - "airplane-post-request-document": { + "data-in-create-passenger-request": { "required": [ - "data" + "type" ], "type": "object", "properties": { - "data": { + "type": { + "$ref": "#/components/schemas/passenger-resource-type" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-post-request" + "$ref": "#/components/schemas/attributes-in-create-passenger-request" } ] } }, "additionalProperties": false }, - "airplane-primary-response-document": { + "data-in-response": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "jsonapi": { - "allOf": [ - { - "$ref": "#/components/schemas/jsonapi" - } - ] + "type": { + "minLength": 1, + "type": "string" }, - "links": { + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "airplanes": "#/components/schemas/airplane-data-in-response", + "flight-attendants": "#/components/schemas/flight-attendant-data-in-response", + "flights": "#/components/schemas/flight-data-in-response", + "passengers": "#/components/schemas/passenger-data-in-response" + } + }, + "x-abstract": true + }, + "data-in-update-airplane-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/airplane-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/resource-top-level-links" + "$ref": "#/components/schemas/attributes-in-update-airplane-request" } ] }, - "data": { + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/airplane-data-in-response" + "$ref": "#/components/schemas/relationships-in-update-airplane-request" } ] - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/data-in-response" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } } }, "additionalProperties": false }, - "airplane-relationships-in-patch-request": { + "data-in-update-flight-attendant-request": { + "required": [ + "id", + "type" + ], "type": "object", "properties": { - "flights": { + "type": { + "$ref": "#/components/schemas/flight-attendant-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-request" + "$ref": "#/components/schemas/attributes-in-update-flight-attendant-request" } ] - } - }, - "additionalProperties": false - }, - "airplane-relationships-in-post-request": { - "type": "object", - "properties": { - "flights": { + }, + "relationships": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-request" + "$ref": "#/components/schemas/relationships-in-update-flight-attendant-request" } ] } }, "additionalProperties": false }, - "airplane-relationships-in-response": { + "data-in-update-flight-request": { + "required": [ + "id", + "type" + ], "type": "object", "properties": { - "flights": { + "type": { + "$ref": "#/components/schemas/flight-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { "allOf": [ { - "$ref": "#/components/schemas/to-many-flight-in-response" + "$ref": "#/components/schemas/attributes-in-update-flight-request" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationships-in-update-flight-request" } ] } }, "additionalProperties": false }, - "airplane-resource-type": { - "enum": [ - "airplanes" - ], - "type": "string", - "additionalProperties": false - }, - "cabin-area": { - "enum": [ - "FirstClass", - "BusinessClass", - "EconomyClass" - ], - "type": "string" - }, - "data-in-response": { + "data-in-update-passenger-request": { "required": [ "id", "type" @@ -6261,25 +6508,21 @@ "type": "object", "properties": { "type": { - "minLength": 1, - "type": "string" + "$ref": "#/components/schemas/passenger-resource-type" }, "id": { "minLength": 1, "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-update-passenger-request" + } + ] } }, - "additionalProperties": false, - "discriminator": { - "propertyName": "type", - "mapping": { - "airplanes": "#/components/schemas/airplane-data-in-response", - "flight-attendants": "#/components/schemas/flight-attendant-data-in-response", - "flights": "#/components/schemas/flight-data-in-response", - "passengers": "#/components/schemas/passenger-data-in-response" - } - }, - "x-abstract": true + "additionalProperties": false }, "error-links": { "type": "object", @@ -6408,48 +6651,6 @@ }, "additionalProperties": false }, - "flight-attendant-attributes-in-patch-request": { - "type": "object", - "properties": { - "email-address": { - "minLength": 1, - "type": "string", - "format": "email" - }, - "age": { - "maximum": 75, - "minimum": 18, - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "flight-attendant-attributes-in-post-request": { - "required": [ - "email-address", - "profile-image-url" - ], - "type": "object", - "properties": { - "email-address": { - "minLength": 1, - "type": "string", - "format": "email" - }, - "age": { - "maximum": 75, - "minimum": 18, - "type": "integer", - "format": "int32" - }, - "profile-image-url": { - "type": "string", - "format": "uri" - } - }, - "additionalProperties": false - }, "flight-attendant-attributes-in-response": { "type": "object", "properties": { @@ -6510,67 +6711,10 @@ }, "meta": { "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "flight-attendant-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-attributes-in-patch-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-relationships-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-attributes-in-post-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-relationships-in-post-request" - } - ] + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -6709,38 +6853,6 @@ }, "additionalProperties": false }, - "flight-attendant-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-attendant-primary-response-document": { "required": [ "data", @@ -6785,46 +6897,6 @@ }, "additionalProperties": false }, - "flight-attendant-relationships-in-patch-request": { - "type": "object", - "properties": { - "scheduled-for-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - }, - "purser-on-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-attendant-relationships-in-post-request": { - "type": "object", - "properties": { - "scheduled-for-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - }, - "purser-on-flights": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-in-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-attendant-relationships-in-response": { "type": "object", "properties": { @@ -6896,28 +6968,6 @@ }, "additionalProperties": false }, - "flight-attributes-in-patch-request": { - "type": "object", - "properties": { - "final-destination": { - "maxLength": 40, - "type": "string" - }, - "stop-over-destination": { - "maxLength": 2000, - "type": "string", - "nullable": true - }, - "operated-by": { - "allOf": [ - { - "$ref": "#/components/schemas/airline" - } - ] - } - }, - "additionalProperties": false - }, "flight-attributes-in-response": { "type": "object", "properties": { @@ -6999,56 +7049,6 @@ }, "additionalProperties": false }, - "flight-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attributes-in-patch-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-relationships-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/flight-resource-type" - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-relationships-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-data-in-response": { "allOf": [ { @@ -7145,38 +7145,6 @@ }, "additionalProperties": false }, - "flight-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-primary-response-document": { "required": [ "data", @@ -7221,77 +7189,6 @@ }, "additionalProperties": false }, - "flight-relationships-in-patch-request": { - "type": "object", - "properties": { - "cabin-crew-members": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-attendant-in-request" - } - ] - }, - "purser": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-flight-attendant-in-request" - } - ] - }, - "backup-purser": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" - } - ] - }, - "passengers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-passenger-in-request" - } - ] - } - }, - "additionalProperties": false - }, - "flight-relationships-in-post-request": { - "required": [ - "purser" - ], - "type": "object", - "properties": { - "cabin-crew-members": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-flight-attendant-in-request" - } - ] - }, - "purser": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-flight-attendant-in-request" - } - ] - }, - "backup-purser": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" - } - ] - }, - "passengers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-passenger-in-request" - } - ] - } - }, - "additionalProperties": false - }, "flight-relationships-in-response": { "type": "object", "properties": { @@ -7484,31 +7381,8 @@ "type": "object", "additionalProperties": { "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "passenger-attributes-in-patch-request": { - "type": "object", - "properties": { - "document-number": { - "maxLength": 9, - "type": "string" - } - }, - "additionalProperties": false - }, - "passenger-attributes-in-post-request": { - "required": [ - "document-number" - ], - "type": "object", - "properties": { - "document-number": { - "maxLength": 9, - "type": "string" + "nullable": true + } } }, "additionalProperties": false @@ -7573,49 +7447,6 @@ }, "additionalProperties": false }, - "passenger-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/passenger-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-attributes-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "passenger-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/passenger-resource-type" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-attributes-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "passenger-data-in-response": { "allOf": [ { @@ -7705,38 +7536,6 @@ }, "additionalProperties": false }, - "passenger-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "passenger-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "passenger-primary-response-document": { "required": [ "data", @@ -7800,6 +7599,143 @@ }, "additionalProperties": false }, + "relationships-in-create-airplane-request": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-create-flight-attendant-request": { + "type": "object", + "properties": { + "scheduled-for-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + }, + "purser-on-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-create-flight-request": { + "required": [ + "purser" + ], + "type": "object", + "properties": { + "cabin-crew-members": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-attendant-in-request" + } + ] + }, + "purser": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-flight-attendant-in-request" + } + ] + }, + "backup-purser": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" + } + ] + }, + "passengers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-passenger-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-airplane-request": { + "type": "object", + "properties": { + "flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-flight-attendant-request": { + "type": "object", + "properties": { + "scheduled-for-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + }, + "purser-on-flights": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-flight-request": { + "type": "object", + "properties": { + "cabin-crew-members": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-flight-attendant-in-request" + } + ] + }, + "purser": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-flight-attendant-in-request" + } + ] + }, + "backup-purser": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-flight-attendant-in-request" + } + ] + }, + "passengers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-passenger-in-request" + } + ] + } + }, + "additionalProperties": false + }, "resource-collection-top-level-links": { "type": "object", "properties": { @@ -8052,6 +7988,70 @@ } }, "additionalProperties": false + }, + "update-airplane-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-airplane-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-flight-attendant-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-flight-attendant-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-flight-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-flight-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-passenger-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-passenger-request" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json index adcd8418ba..c858eeea55 100644 --- a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/accommodationPostRequestDocument" + "$ref": "#/components/schemas/createAccommodationRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/accommodationPatchRequestDocument" + "$ref": "#/components/schemas/updateAccommodationRequestDocument" } ] } @@ -743,7 +743,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/excursionPostRequestDocument" + "$ref": "#/components/schemas/createExcursionRequestDocument" } ] } @@ -1038,7 +1038,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/excursionPatchRequestDocument" + "$ref": "#/components/schemas/updateExcursionRequestDocument" } ] } @@ -1306,7 +1306,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/transportPostRequestDocument" + "$ref": "#/components/schemas/createTransportRequestDocument" } ] } @@ -1601,7 +1601,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/transportPatchRequestDocument" + "$ref": "#/components/schemas/updateTransportRequestDocument" } ] } @@ -1869,7 +1869,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/vacationPostRequestDocument" + "$ref": "#/components/schemas/createVacationRequestDocument" } ] } @@ -2164,7 +2164,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/vacationPatchRequestDocument" + "$ref": "#/components/schemas/updateVacationRequestDocument" } ] } @@ -3649,27 +3649,6 @@ }, "components": { "schemas": { - "accommodationAttributesInPatchRequest": { - "type": "object", - "properties": { - "address": { - "type": "string" - } - }, - "additionalProperties": false - }, - "accommodationAttributesInPostRequest": { - "required": [ - "address" - ], - "type": "object", - "properties": { - "address": { - "type": "string" - } - }, - "additionalProperties": false - }, "accommodationAttributesInResponse": { "type": "object", "properties": { @@ -3715,49 +3694,6 @@ }, "additionalProperties": false }, - "accommodationDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/accommodationResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/accommodationAttributesInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "accommodationDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/accommodationResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/accommodationAttributesInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "accommodationDataInResponse": { "allOf": [ { @@ -3841,38 +3777,6 @@ }, "additionalProperties": false }, - "accommodationPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/accommodationDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "accommodationPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/accommodationDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "accommodationPrimaryResponseDocument": { "required": [ "data", @@ -3954,155 +3858,84 @@ }, "additionalProperties": false }, - "dataInResponse": { + "attributesInCreateAccommodationRequest": { "required": [ - "id", - "type" + "address" ], "type": "object", "properties": { - "type": { - "minLength": 1, - "type": "string" - }, - "id": { - "minLength": 1, + "address": { "type": "string" } }, - "additionalProperties": false, - "discriminator": { - "propertyName": "type", - "mapping": { - "accommodations": "#/components/schemas/accommodationDataInResponse", - "excursions": "#/components/schemas/excursionDataInResponse", - "transports": "#/components/schemas/transportDataInResponse", - "vacations": "#/components/schemas/vacationDataInResponse" - } - }, - "x-abstract": true - }, - "errorLinks": { - "type": "object", - "properties": { - "about": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - } - }, "additionalProperties": false }, - "errorObject": { + "attributesInCreateExcursionRequest": { + "required": [ + "description", + "occursAt" + ], "type": "object", "properties": { - "id": { + "occursAt": { "type": "string", - "nullable": true - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/errorLinks" - } - ], - "nullable": true + "format": "date-time" }, - "status": { + "description": { "type": "string" - }, - "code": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "source": { - "allOf": [ - { - "$ref": "#/components/schemas/errorSource" - } - ], - "nullable": true - }, - "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true } }, "additionalProperties": false }, - "errorResponseDocument": { + "attributesInCreateTransportRequest": { "required": [ - "errors", - "links" + "durationInMinutes", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/errorTopLevelLinks" + "$ref": "#/components/schemas/transportType" } ] }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/errorObject" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "durationInMinutes": { + "type": "integer", + "format": "int32" } }, "additionalProperties": false }, - "errorSource": { + "attributesInCreateVacationRequest": { + "required": [ + "endsAt", + "startsAt" + ], "type": "object", "properties": { - "pointer": { - "type": "string", - "nullable": true - }, - "parameter": { + "startsAt": { "type": "string", - "nullable": true + "format": "date-time" }, - "header": { + "endsAt": { "type": "string", - "nullable": true + "format": "date-time" } }, "additionalProperties": false }, - "errorTopLevelLinks": { + "attributesInUpdateAccommodationRequest": { "type": "object", "properties": { - "self": { - "type": "string" - }, - "describedby": { + "address": { "type": "string" } }, "additionalProperties": false }, - "excursionAttributesInPatchRequest": { + "attributesInUpdateExcursionRequest": { "type": "object", "properties": { "occursAt": { @@ -4115,111 +3948,480 @@ }, "additionalProperties": false }, - "excursionAttributesInPostRequest": { - "required": [ - "description", - "occursAt" - ], + "attributesInUpdateTransportRequest": { "type": "object", "properties": { - "occursAt": { - "type": "string", - "format": "date-time" + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/transportType" + } + ] }, - "description": { - "type": "string" + "durationInMinutes": { + "type": "integer", + "format": "int32" } }, "additionalProperties": false }, - "excursionAttributesInResponse": { + "attributesInUpdateVacationRequest": { "type": "object", "properties": { - "occursAt": { + "startsAt": { "type": "string", "format": "date-time" }, - "description": { - "type": "string" + "endsAt": { + "type": "string", + "format": "date-time" } }, "additionalProperties": false }, - "excursionCollectionResponseDocument": { + "createAccommodationRequestDocument": { "required": [ - "data", - "links" + "data" ], "type": "object", "properties": { - "links": { + "data": { "allOf": [ { - "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" + "$ref": "#/components/schemas/dataInCreateAccommodationRequest" } ] - }, + } + }, + "additionalProperties": false + }, + "createExcursionRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/excursionDataInResponse" - } + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateExcursionRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createTransportRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTransportRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createVacationRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateVacationRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateAccommodationRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/accommodationResourceType" }, - "included": { + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateAccommodationRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateExcursionRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/excursionResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateExcursionRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateTransportRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/transportResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateTransportRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateVacationRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/vacationResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateVacationRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateVacationRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "minLength": 1, + "type": "string" + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "accommodations": "#/components/schemas/accommodationDataInResponse", + "excursions": "#/components/schemas/excursionDataInResponse", + "transports": "#/components/schemas/transportDataInResponse", + "vacations": "#/components/schemas/vacationDataInResponse" + } + }, + "x-abstract": true + }, + "dataInUpdateAccommodationRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/accommodationResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateAccommodationRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateExcursionRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/excursionResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateExcursionRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateTransportRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/transportResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateTransportRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateVacationRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/vacationResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateVacationRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateVacationRequest" + } + ] + } + }, + "additionalProperties": false + }, + "errorLinks": { + "type": "object", + "properties": { + "about": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorObject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorLinks" + } + ], + "nullable": true + }, + "status": { + "type": "string" + }, + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "source": { + "allOf": [ + { + "$ref": "#/components/schemas/errorSource" + } + ], + "nullable": true + }, + "meta": { + "type": "object", + "additionalProperties": { }, + "nullable": true + } + }, + "additionalProperties": false + }, + "errorResponseDocument": { + "required": [ + "errors", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorTopLevelLinks" + } + ] + }, + "errors": { "type": "array", "items": { - "$ref": "#/components/schemas/dataInResponse" + "$ref": "#/components/schemas/errorObject" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true } + } + }, + "additionalProperties": false + }, + "errorSource": { + "type": "object", + "properties": { + "pointer": { + "type": "string", + "nullable": true }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "parameter": { + "type": "string", + "nullable": true + }, + "header": { + "type": "string", + "nullable": true } }, "additionalProperties": false }, - "excursionDataInPatchRequest": { - "required": [ - "id", - "type" - ], + "errorTopLevelLinks": { "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/excursionResourceType" + "self": { + "type": "string" }, - "id": { - "minLength": 1, + "describedby": { "type": "string" + } + }, + "additionalProperties": false + }, + "excursionAttributesInResponse": { + "type": "object", + "properties": { + "occursAt": { + "type": "string", + "format": "date-time" }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/excursionAttributesInPatchRequest" - } - ] + "description": { + "type": "string" } }, "additionalProperties": false }, - "excursionDataInPostRequest": { + "excursionCollectionResponseDocument": { "required": [ - "type" + "data", + "links" ], "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/excursionResourceType" - }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/excursionAttributesInPostRequest" + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" } ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/excursionDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -4306,38 +4508,6 @@ }, "additionalProperties": false }, - "excursionPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/excursionDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "excursionPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/excursionDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "excursionPrimaryResponseDocument": { "required": [ "data", @@ -4509,6 +4679,63 @@ }, "additionalProperties": false }, + "relationshipsInCreateVacationRequest": { + "required": [ + "accommodation" + ], + "type": "object", + "properties": { + "accommodation": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneAccommodationInRequest" + } + ] + }, + "transport": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTransportInRequest" + } + ] + }, + "excursions": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyExcursionInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateVacationRequest": { + "type": "object", + "properties": { + "accommodation": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneAccommodationInRequest" + } + ] + }, + "transport": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTransportInRequest" + } + ] + }, + "excursions": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyExcursionInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -4680,136 +4907,55 @@ }, "additionalProperties": false }, - "transportAttributesInPatchRequest": { - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/transportType" - } - ] - }, - "durationInMinutes": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "transportAttributesInPostRequest": { - "required": [ - "durationInMinutes", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/transportType" - } - ] - }, - "durationInMinutes": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, "transportAttributesInResponse": { "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/transportType" - } - ] - }, - "durationInMinutes": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "transportCollectionResponseDocument": { - "required": [ - "data", - "links" - ], - "type": "object", - "properties": { - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" - } - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/transportDataInResponse" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/dataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "transportDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/transportResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { + "properties": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/transportAttributesInPatchRequest" + "$ref": "#/components/schemas/transportType" } ] + }, + "durationInMinutes": { + "type": "integer", + "format": "int32" } }, "additionalProperties": false }, - "transportDataInPostRequest": { + "transportCollectionResponseDocument": { "required": [ - "type" + "data", + "links" ], "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/transportResourceType" - }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/transportAttributesInPostRequest" + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" } ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/transportDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -4866,38 +5012,6 @@ }, "additionalProperties": false }, - "transportPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/transportDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "transportPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/transportDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "transportPrimaryResponseDocument": { "required": [ "data", @@ -4952,34 +5066,66 @@ "type": "integer", "format": "int32" }, - "vacationAttributesInPatchRequest": { + "updateAccommodationRequestDocument": { + "required": [ + "data" + ], "type": "object", "properties": { - "startsAt": { - "type": "string", - "format": "date-time" - }, - "endsAt": { - "type": "string", - "format": "date-time" + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateAccommodationRequest" + } + ] } }, "additionalProperties": false }, - "vacationAttributesInPostRequest": { + "updateExcursionRequestDocument": { "required": [ - "endsAt", - "startsAt" + "data" ], "type": "object", "properties": { - "startsAt": { - "type": "string", - "format": "date-time" - }, - "endsAt": { - "type": "string", - "format": "date-time" + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateExcursionRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateTransportRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTransportRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateVacationRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateVacationRequest" + } + ] } }, "additionalProperties": false @@ -5034,63 +5180,6 @@ }, "additionalProperties": false }, - "vacationDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/vacationResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "vacationDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/vacationResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "vacationDataInResponse": { "allOf": [ { @@ -5133,38 +5222,6 @@ ], "additionalProperties": false }, - "vacationPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "vacationPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/vacationDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "vacationPrimaryResponseDocument": { "required": [ "data", @@ -5202,63 +5259,6 @@ }, "additionalProperties": false }, - "vacationRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "accommodation": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneAccommodationInRequest" - } - ] - }, - "transport": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneTransportInRequest" - } - ] - }, - "excursions": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyExcursionInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "vacationRelationshipsInPostRequest": { - "required": [ - "accommodation" - ], - "type": "object", - "properties": { - "accommodation": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneAccommodationInRequest" - } - ] - }, - "transport": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneTransportInRequest" - } - ] - }, - "excursions": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyExcursionInRequest" - } - ] - } - }, - "additionalProperties": false - }, "vacationRelationshipsInResponse": { "type": "object", "properties": { diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json index efc8773a85..398dc6cda2 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json @@ -39,7 +39,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/socialMediaAccountPostRequestDocument" + "$ref": "#/components/schemas/createSocialMediaAccountRequestDocument" } ] } @@ -162,7 +162,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/socialMediaAccountPatchRequestDocument" + "$ref": "#/components/schemas/updateSocialMediaAccountRequestDocument" } ] } @@ -230,173 +230,10 @@ }, "components": { "schemas": { - "dataInResponse": { + "attributesInCreateSocialMediaAccountRequest": { "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "minLength": 1, - "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false, - "discriminator": { - "propertyName": "type", - "mapping": { - "socialMediaAccounts": "#/components/schemas/socialMediaAccountDataInResponse" - } - }, - "x-abstract": true - }, - "errorLinks": { - "type": "object", - "properties": { - "about": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "errorObject": { - "type": "object", - "properties": { - "id": { - "type": "string", - "nullable": true - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/errorLinks" - } - ], - "nullable": true - }, - "status": { - "type": "string" - }, - "code": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "source": { - "allOf": [ - { - "$ref": "#/components/schemas/errorSource" - } - ], - "nullable": true - }, - "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true - } - }, - "additionalProperties": false - }, - "errorResponseDocument": { - "required": [ - "errors", - "links" + "lastName" ], - "type": "object", - "properties": { - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/errorTopLevelLinks" - } - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/errorObject" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "errorSource": { - "type": "object", - "properties": { - "pointer": { - "type": "string", - "nullable": true - }, - "parameter": { - "type": "string", - "nullable": true - }, - "header": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "errorTopLevelLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - }, - "describedby": { - "type": "string" - } - }, - "additionalProperties": false - }, - "resourceLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - } - }, - "additionalProperties": false - }, - "resourceTopLevelLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - }, - "describedby": { - "type": "string" - } - }, - "additionalProperties": false - }, - "socialMediaAccountAttributesInPatchRequest": { "type": "object", "properties": { "alternativeId": { @@ -492,10 +329,7 @@ }, "additionalProperties": false }, - "socialMediaAccountAttributesInPostRequest": { - "required": [ - "lastName" - ], + "attributesInUpdateSocialMediaAccountRequest": { "type": "object", "properties": { "alternativeId": { @@ -591,6 +425,231 @@ }, "additionalProperties": false }, + "createSocialMediaAccountRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateSocialMediaAccountRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "minLength": 1, + "type": "string" + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "socialMediaAccounts": "#/components/schemas/socialMediaAccountDataInResponse" + } + }, + "x-abstract": true + }, + "dataInUpdateSocialMediaAccountRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "errorLinks": { + "type": "object", + "properties": { + "about": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorObject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorLinks" + } + ], + "nullable": true + }, + "status": { + "type": "string" + }, + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "source": { + "allOf": [ + { + "$ref": "#/components/schemas/errorSource" + } + ], + "nullable": true + }, + "meta": { + "type": "object", + "additionalProperties": { }, + "nullable": true + } + }, + "additionalProperties": false + }, + "errorResponseDocument": { + "required": [ + "errors", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorTopLevelLinks" + } + ] + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/errorObject" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "errorSource": { + "type": "object", + "properties": { + "pointer": { + "type": "string", + "nullable": true + }, + "parameter": { + "type": "string", + "nullable": true + }, + "header": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, "socialMediaAccountAttributesInResponse": { "type": "object", "properties": { @@ -687,49 +746,6 @@ }, "additionalProperties": false }, - "socialMediaAccountDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountAttributesInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "socialMediaAccountDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountAttributesInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "socialMediaAccountDataInResponse": { "allOf": [ { @@ -765,38 +781,6 @@ ], "additionalProperties": false }, - "socialMediaAccountPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "socialMediaAccountPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "socialMediaAccountPrimaryResponseDocument": { "required": [ "data", @@ -840,6 +824,22 @@ ], "type": "string", "additionalProperties": false + }, + "updateSocialMediaAccountRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json index 234b2b7e9b..c6ea2c8078 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json @@ -39,7 +39,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/socialMediaAccountPostRequestDocument" + "$ref": "#/components/schemas/createSocialMediaAccountRequestDocument" } ] } @@ -162,7 +162,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/socialMediaAccountPatchRequestDocument" + "$ref": "#/components/schemas/updateSocialMediaAccountRequestDocument" } ] } @@ -230,173 +230,10 @@ }, "components": { "schemas": { - "dataInResponse": { + "attributesInCreateSocialMediaAccountRequest": { "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "minLength": 1, - "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false, - "discriminator": { - "propertyName": "type", - "mapping": { - "socialMediaAccounts": "#/components/schemas/socialMediaAccountDataInResponse" - } - }, - "x-abstract": true - }, - "errorLinks": { - "type": "object", - "properties": { - "about": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "errorObject": { - "type": "object", - "properties": { - "id": { - "type": "string", - "nullable": true - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/errorLinks" - } - ], - "nullable": true - }, - "status": { - "type": "string" - }, - "code": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "source": { - "allOf": [ - { - "$ref": "#/components/schemas/errorSource" - } - ], - "nullable": true - }, - "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true - } - }, - "additionalProperties": false - }, - "errorResponseDocument": { - "required": [ - "errors", - "links" + "lastName" ], - "type": "object", - "properties": { - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/errorTopLevelLinks" - } - ] - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/errorObject" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "errorSource": { - "type": "object", - "properties": { - "pointer": { - "type": "string", - "nullable": true - }, - "parameter": { - "type": "string", - "nullable": true - }, - "header": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "errorTopLevelLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - }, - "describedby": { - "type": "string" - } - }, - "additionalProperties": false - }, - "resourceLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - } - }, - "additionalProperties": false - }, - "resourceTopLevelLinks": { - "type": "object", - "properties": { - "self": { - "type": "string" - }, - "describedby": { - "type": "string" - } - }, - "additionalProperties": false - }, - "socialMediaAccountAttributesInPatchRequest": { "type": "object", "properties": { "alternativeId": { @@ -501,10 +338,7 @@ }, "additionalProperties": false }, - "socialMediaAccountAttributesInPostRequest": { - "required": [ - "lastName" - ], + "attributesInUpdateSocialMediaAccountRequest": { "type": "object", "properties": { "alternativeId": { @@ -609,6 +443,231 @@ }, "additionalProperties": false }, + "createSocialMediaAccountRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateSocialMediaAccountRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "minLength": 1, + "type": "string" + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "socialMediaAccounts": "#/components/schemas/socialMediaAccountDataInResponse" + } + }, + "x-abstract": true + }, + "dataInUpdateSocialMediaAccountRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false + }, + "errorLinks": { + "type": "object", + "properties": { + "about": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorObject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorLinks" + } + ], + "nullable": true + }, + "status": { + "type": "string" + }, + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "source": { + "allOf": [ + { + "$ref": "#/components/schemas/errorSource" + } + ], + "nullable": true + }, + "meta": { + "type": "object", + "additionalProperties": { }, + "nullable": true + } + }, + "additionalProperties": false + }, + "errorResponseDocument": { + "required": [ + "errors", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorTopLevelLinks" + } + ] + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/errorObject" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } + } + }, + "additionalProperties": false + }, + "errorSource": { + "type": "object", + "properties": { + "pointer": { + "type": "string", + "nullable": true + }, + "parameter": { + "type": "string", + "nullable": true + }, + "header": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, "socialMediaAccountAttributesInResponse": { "type": "object", "properties": { @@ -714,49 +773,6 @@ }, "additionalProperties": false }, - "socialMediaAccountDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountAttributesInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "socialMediaAccountDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountAttributesInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "socialMediaAccountDataInResponse": { "allOf": [ { @@ -792,38 +808,6 @@ ], "additionalProperties": false }, - "socialMediaAccountPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "socialMediaAccountPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/socialMediaAccountDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "socialMediaAccountPrimaryResponseDocument": { "required": [ "data", @@ -867,6 +851,22 @@ ], "type": "string", "additionalProperties": false + }, + "updateSocialMediaAccountRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateSocialMediaAccountRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ModelStateValidation/ModelStateValidationTests.cs b/test/OpenApiTests/ModelStateValidation/ModelStateValidationTests.cs index a27c2e4d25..facb2f3078 100644 --- a/test/OpenApiTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/OpenApiTests/ModelStateValidation/ModelStateValidationTests.cs @@ -9,8 +9,8 @@ public sealed class ModelStateValidationTests : IClassFixture SchemaNames = new() { - "socialMediaAccountAttributesInPostRequest", - "socialMediaAccountAttributesInPatchRequest", + "attributesInCreateSocialMediaAccountRequest", + "attributesInUpdateSocialMediaAccountRequest", "socialMediaAccountAttributesInResponse" }; diff --git a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs index 654b5b350b..706ad47ba2 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs @@ -142,9 +142,9 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; }); - schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum[0]").With(enumValueElement => + schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => { - enumValueElement.Should().Be("staffMembers"); + codeElement.Should().ContainArrayElement("staffMembers"); }); }); } @@ -380,7 +380,7 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarketPostRequestDocument").SchemaReferenceId; + .ShouldBeSchemaReferenceId("createSupermarketRequestDocument").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -389,18 +389,18 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { - resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketDataInPostRequest") - .SchemaReferenceId; + resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") + .ShouldBeSchemaReferenceId("dataInCreateSupermarketRequest").SchemaReferenceId; }); string? resourceRelationshipInPostRequestSchemaRefId = null; schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketAttributesInPostRequest"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("attributesInCreateSupermarketRequest"); resourceRelationshipInPostRequestSchemaRefId = propertiesElement.Should().ContainPath("relationships.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarketRelationshipsInPostRequest").SchemaReferenceId; + .ShouldBeSchemaReferenceId("relationshipsInCreateSupermarketRequest").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceRelationshipInPostRequestSchemaRefId}.properties").With(propertiesElement => @@ -450,7 +450,7 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarketPatchRequestDocument").SchemaReferenceId; + .ShouldBeSchemaReferenceId("updateSupermarketRequestDocument").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -460,13 +460,13 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarketDataInPatchRequest").SchemaReferenceId; + .ShouldBeSchemaReferenceId("dataInUpdateSupermarketRequest").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketAttributesInPatchRequest"); - propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketRelationshipsInPatchRequest"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("attributesInUpdateSupermarketRequest"); + propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("relationshipsInUpdateSupermarketRequest"); }); }); } diff --git a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json index 3fae1e7323..caa16e36d2 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberPostRequestDocument" + "$ref": "#/components/schemas/createStaffMemberRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberPatchRequestDocument" + "$ref": "#/components/schemas/updateStaffMemberRequestDocument" } ] } @@ -743,7 +743,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/supermarketPostRequestDocument" + "$ref": "#/components/schemas/createSupermarketRequestDocument" } ] } @@ -1038,7 +1038,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/supermarketPatchRequestDocument" + "$ref": "#/components/schemas/updateSupermarketRequestDocument" } ] } @@ -2523,6 +2523,147 @@ }, "components": { "schemas": { + "attributesInCreateStaffMemberRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributesInCreateSupermarketRequest": { + "required": [ + "nameOfCity" + ], + "type": "object", + "properties": { + "nameOfCity": { + "type": "string" + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketType" + } + ] + } + }, + "additionalProperties": false + }, + "attributesInUpdateStaffMemberRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributesInUpdateSupermarketRequest": { + "type": "object", + "properties": { + "nameOfCity": { + "type": "string" + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketType" + } + ] + } + }, + "additionalProperties": false + }, + "createStaffMemberRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createSupermarketRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateStaffMemberRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/staffMemberResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateSupermarketRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/supermarketResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateSupermarketRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -2549,6 +2690,61 @@ }, "x-abstract": true }, + "dataInUpdateStaffMemberRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/staffMemberResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateSupermarketRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/supermarketResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateSupermarketRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -2845,6 +3041,63 @@ }, "additionalProperties": false }, + "relationshipsInCreateSupermarketRequest": { + "required": [ + "storeManager" + ], + "type": "object", + "properties": { + "storeManager": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStaffMemberInRequest" + } + ] + }, + "backupStoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneStaffMemberInRequest" + } + ] + }, + "cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStaffMemberInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateSupermarketRequest": { + "type": "object", + "properties": { + "storeManager": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStaffMemberInRequest" + } + ] + }, + "backupStoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneStaffMemberInRequest" + } + ] + }, + "cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStaffMemberInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -2932,35 +3185,6 @@ }, "additionalProperties": false }, - "staffMemberAttributesInPatchRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "staffMemberAttributesInPostRequest": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, "staffMemberAttributesInResponse": { "type": "object", "properties": { @@ -2976,86 +3200,43 @@ }, "staffMemberCollectionResponseDocument": { "required": [ - "data", - "links" - ], - "type": "object", - "properties": { - "jsonapi": { - "allOf": [ - { - "$ref": "#/components/schemas/jsonapi" - } - ] - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" - } - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/staffMemberDataInResponse" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/dataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "staffMemberDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/staffMemberResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/staffMemberAttributesInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "staffMemberDataInPostRequest": { - "required": [ - "type" + "data", + "links" ], "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/staffMemberResourceType" + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberAttributesInPostRequest" + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" } ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staffMemberDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -3187,38 +3368,6 @@ }, "additionalProperties": false }, - "staffMemberPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/staffMemberDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "staffMemberPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/staffMemberDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "staffMemberPrimaryResponseDocument": { "required": [ "data", @@ -3314,41 +3463,6 @@ }, "additionalProperties": false }, - "supermarketAttributesInPatchRequest": { - "type": "object", - "properties": { - "nameOfCity": { - "type": "string" - }, - "kind": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketType" - } - ] - } - }, - "additionalProperties": false - }, - "supermarketAttributesInPostRequest": { - "required": [ - "nameOfCity" - ], - "type": "object", - "properties": { - "nameOfCity": { - "type": "string" - }, - "kind": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketType" - } - ] - } - }, - "additionalProperties": false - }, "supermarketAttributesInResponse": { "type": "object", "properties": { @@ -3408,63 +3522,6 @@ }, "additionalProperties": false }, - "supermarketDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/supermarketResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "supermarketDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/supermarketResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "supermarketDataInResponse": { "allOf": [ { @@ -3507,38 +3564,6 @@ ], "additionalProperties": false }, - "supermarketPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "supermarketPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarketDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "supermarketPrimaryResponseDocument": { "required": [ "data", @@ -3583,63 +3608,6 @@ }, "additionalProperties": false }, - "supermarketRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "storeManager": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneStaffMemberInRequest" - } - ] - }, - "backupStoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneStaffMemberInRequest" - } - ] - }, - "cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyStaffMemberInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "supermarketRelationshipsInPostRequest": { - "required": [ - "storeManager" - ], - "type": "object", - "properties": { - "storeManager": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneStaffMemberInRequest" - } - ] - }, - "backupStoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneStaffMemberInRequest" - } - ] - }, - "cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyStaffMemberInRequest" - } - ] - } - }, - "additionalProperties": false - }, "supermarketRelationshipsInResponse": { "type": "object", "properties": { @@ -3765,6 +3733,38 @@ } }, "additionalProperties": false + }, + "updateStaffMemberRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateSupermarketRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json index f3ee10e406..cf18edaf55 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-post-request-document" + "$ref": "#/components/schemas/create-staff-member-request-document" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-patch-request-document" + "$ref": "#/components/schemas/update-staff-member-request-document" } ] } @@ -743,7 +743,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/supermarket-post-request-document" + "$ref": "#/components/schemas/create-supermarket-request-document" } ] } @@ -1038,7 +1038,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/supermarket-patch-request-document" + "$ref": "#/components/schemas/update-supermarket-request-document" } ] } @@ -2523,6 +2523,147 @@ }, "components": { "schemas": { + "attributes-in-create-staff-member-request": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributes-in-create-supermarket-request": { + "required": [ + "name-of-city" + ], + "type": "object", + "properties": { + "name-of-city": { + "type": "string" + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-type" + } + ] + } + }, + "additionalProperties": false + }, + "attributes-in-update-staff-member-request": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributes-in-update-supermarket-request": { + "type": "object", + "properties": { + "name-of-city": { + "type": "string" + }, + "kind": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-type" + } + ] + } + }, + "additionalProperties": false + }, + "create-staff-member-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-staff-member-request" + } + ] + } + }, + "additionalProperties": false + }, + "create-supermarket-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-supermarket-request" + } + ] + } + }, + "additionalProperties": false + }, + "data-in-create-staff-member-request": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/staff-member-resource-type" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-create-staff-member-request" + } + ] + } + }, + "additionalProperties": false + }, + "data-in-create-supermarket-request": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/supermarket-resource-type" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-create-supermarket-request" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationships-in-create-supermarket-request" + } + ] + } + }, + "additionalProperties": false + }, "data-in-response": { "required": [ "id", @@ -2549,6 +2690,61 @@ }, "x-abstract": true }, + "data-in-update-staff-member-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/staff-member-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-update-staff-member-request" + } + ] + } + }, + "additionalProperties": false + }, + "data-in-update-supermarket-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/supermarket-resource-type" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributes-in-update-supermarket-request" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationships-in-update-supermarket-request" + } + ] + } + }, + "additionalProperties": false + }, "error-links": { "type": "object", "properties": { @@ -2845,6 +3041,63 @@ }, "additionalProperties": false }, + "relationships-in-create-supermarket-request": { + "required": [ + "store-manager" + ], + "type": "object", + "properties": { + "store-manager": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-staff-member-in-request" + } + ] + }, + "backup-store-manager": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-staff-member-in-request" + } + ] + }, + "cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-staff-member-in-request" + } + ] + } + }, + "additionalProperties": false + }, + "relationships-in-update-supermarket-request": { + "type": "object", + "properties": { + "store-manager": { + "allOf": [ + { + "$ref": "#/components/schemas/to-one-staff-member-in-request" + } + ] + }, + "backup-store-manager": { + "allOf": [ + { + "$ref": "#/components/schemas/nullable-to-one-staff-member-in-request" + } + ] + }, + "cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/to-many-staff-member-in-request" + } + ] + } + }, + "additionalProperties": false + }, "resource-collection-top-level-links": { "type": "object", "properties": { @@ -2932,35 +3185,6 @@ }, "additionalProperties": false }, - "staff-member-attributes-in-patch-request": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "staff-member-attributes-in-post-request": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, "staff-member-attributes-in-response": { "type": "object", "properties": { @@ -2976,86 +3200,43 @@ }, "staff-member-collection-response-document": { "required": [ - "data", - "links" - ], - "type": "object", - "properties": { - "jsonapi": { - "allOf": [ - { - "$ref": "#/components/schemas/jsonapi" - } - ] - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/resource-collection-top-level-links" - } - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/staff-member-data-in-response" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/data-in-response" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "staff-member-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/staff-member-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/staff-member-attributes-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "staff-member-data-in-post-request": { - "required": [ - "type" + "data", + "links" ], "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/staff-member-resource-type" + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-attributes-in-post-request" + "$ref": "#/components/schemas/resource-collection-top-level-links" } ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staff-member-data-in-response" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/data-in-response" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -3187,38 +3368,6 @@ }, "additionalProperties": false }, - "staff-member-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/staff-member-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "staff-member-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/staff-member-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "staff-member-primary-response-document": { "required": [ "data", @@ -3314,41 +3463,6 @@ }, "additionalProperties": false }, - "supermarket-attributes-in-patch-request": { - "type": "object", - "properties": { - "name-of-city": { - "type": "string" - }, - "kind": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-type" - } - ] - } - }, - "additionalProperties": false - }, - "supermarket-attributes-in-post-request": { - "required": [ - "name-of-city" - ], - "type": "object", - "properties": { - "name-of-city": { - "type": "string" - }, - "kind": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-type" - } - ] - } - }, - "additionalProperties": false - }, "supermarket-attributes-in-response": { "type": "object", "properties": { @@ -3408,63 +3522,6 @@ }, "additionalProperties": false }, - "supermarket-data-in-patch-request": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/supermarket-resource-type" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-attributes-in-patch-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-relationships-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "supermarket-data-in-post-request": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/supermarket-resource-type" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-attributes-in-post-request" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-relationships-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "supermarket-data-in-response": { "allOf": [ { @@ -3507,38 +3564,6 @@ ], "additionalProperties": false }, - "supermarket-patch-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-data-in-patch-request" - } - ] - } - }, - "additionalProperties": false - }, - "supermarket-post-request-document": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/supermarket-data-in-post-request" - } - ] - } - }, - "additionalProperties": false - }, "supermarket-primary-response-document": { "required": [ "data", @@ -3583,63 +3608,6 @@ }, "additionalProperties": false }, - "supermarket-relationships-in-patch-request": { - "type": "object", - "properties": { - "store-manager": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-staff-member-in-request" - } - ] - }, - "backup-store-manager": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-staff-member-in-request" - } - ] - }, - "cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-staff-member-in-request" - } - ] - } - }, - "additionalProperties": false - }, - "supermarket-relationships-in-post-request": { - "required": [ - "store-manager" - ], - "type": "object", - "properties": { - "store-manager": { - "allOf": [ - { - "$ref": "#/components/schemas/to-one-staff-member-in-request" - } - ] - }, - "backup-store-manager": { - "allOf": [ - { - "$ref": "#/components/schemas/nullable-to-one-staff-member-in-request" - } - ] - }, - "cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/to-many-staff-member-in-request" - } - ] - } - }, - "additionalProperties": false - }, "supermarket-relationships-in-response": { "type": "object", "properties": { @@ -3765,6 +3733,38 @@ } }, "additionalProperties": false + }, + "update-staff-member-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-staff-member-request" + } + ] + } + }, + "additionalProperties": false + }, + "update-supermarket-request-document": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-supermarket-request" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs index 8962a56db6..7d9a950163 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs @@ -142,9 +142,9 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; }); - schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum[0]").With(enumValueElement => + schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => { - enumValueElement.Should().Be("staff-members"); + codeElement.Should().ContainArrayElement("staff-members"); }); }); } @@ -380,7 +380,7 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarket-post-request-document").SchemaReferenceId; + .ShouldBeSchemaReferenceId("create-supermarket-request-document").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -390,17 +390,17 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarket-data-in-post-request").SchemaReferenceId; + .ShouldBeSchemaReferenceId("data-in-create-supermarket-request").SchemaReferenceId; }); string? resourceRelationshipInPostRequestSchemaRefId = null; schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-attributes-in-post-request"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("attributes-in-create-supermarket-request"); resourceRelationshipInPostRequestSchemaRefId = propertiesElement.Should().ContainPath("relationships.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarket-relationships-in-post-request").SchemaReferenceId; + .ShouldBeSchemaReferenceId("relationships-in-create-supermarket-request").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceRelationshipInPostRequestSchemaRefId}.properties").With(propertiesElement => @@ -452,7 +452,7 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarket-patch-request-document").SchemaReferenceId; + .ShouldBeSchemaReferenceId("update-supermarket-request-document").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -462,13 +462,13 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("supermarket-data-in-patch-request").SchemaReferenceId; + .ShouldBeSchemaReferenceId("data-in-update-supermarket-request").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-attributes-in-patch-request"); - propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-relationships-in-patch-request"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("attributes-in-update-supermarket-request"); + propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("relationships-in-update-supermarket-request"); }); }); } diff --git a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json index cbbd39fce4..1c8a2cd5c2 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberPostRequestDocument" + "$ref": "#/components/schemas/CreateStaffMemberRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberPatchRequestDocument" + "$ref": "#/components/schemas/UpdateStaffMemberRequestDocument" } ] } @@ -743,7 +743,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SupermarketPostRequestDocument" + "$ref": "#/components/schemas/CreateSupermarketRequestDocument" } ] } @@ -1038,7 +1038,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/SupermarketPatchRequestDocument" + "$ref": "#/components/schemas/UpdateSupermarketRequestDocument" } ] } @@ -2523,6 +2523,147 @@ }, "components": { "schemas": { + "AttributesInCreateStaffMemberRequest": { + "required": [ + "Name" + ], + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "AttributesInCreateSupermarketRequest": { + "required": [ + "NameOfCity" + ], + "type": "object", + "properties": { + "NameOfCity": { + "type": "string" + }, + "Kind": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketType" + } + ] + } + }, + "additionalProperties": false + }, + "AttributesInUpdateStaffMemberRequest": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Age": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "AttributesInUpdateSupermarketRequest": { + "type": "object", + "properties": { + "NameOfCity": { + "type": "string" + }, + "Kind": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketType" + } + ] + } + }, + "additionalProperties": false + }, + "CreateStaffMemberRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "CreateSupermarketRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, + "DataInCreateStaffMemberRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/StaffMemberResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/AttributesInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "DataInCreateSupermarketRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/SupermarketResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/AttributesInCreateSupermarketRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/RelationshipsInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, "DataInResponse": { "required": [ "id", @@ -2549,6 +2690,61 @@ }, "x-abstract": true }, + "DataInUpdateStaffMemberRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/StaffMemberResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/AttributesInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "DataInUpdateSupermarketRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/SupermarketResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/AttributesInUpdateSupermarketRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/RelationshipsInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + }, "ErrorLinks": { "type": "object", "properties": { @@ -2845,6 +3041,63 @@ }, "additionalProperties": false }, + "RelationshipsInCreateSupermarketRequest": { + "required": [ + "StoreManager" + ], + "type": "object", + "properties": { + "StoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/ToOneStaffMemberInRequest" + } + ] + }, + "BackupStoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/NullableToOneStaffMemberInRequest" + } + ] + }, + "Cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/ToManyStaffMemberInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "RelationshipsInUpdateSupermarketRequest": { + "type": "object", + "properties": { + "StoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/ToOneStaffMemberInRequest" + } + ] + }, + "BackupStoreManager": { + "allOf": [ + { + "$ref": "#/components/schemas/NullableToOneStaffMemberInRequest" + } + ] + }, + "Cashiers": { + "allOf": [ + { + "$ref": "#/components/schemas/ToManyStaffMemberInRequest" + } + ] + } + }, + "additionalProperties": false + }, "ResourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -2932,35 +3185,6 @@ }, "additionalProperties": false }, - "StaffMemberAttributesInPatchRequest": { - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "StaffMemberAttributesInPostRequest": { - "required": [ - "Name" - ], - "type": "object", - "properties": { - "Name": { - "type": "string" - }, - "Age": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, "StaffMemberAttributesInResponse": { "type": "object", "properties": { @@ -2976,86 +3200,43 @@ }, "StaffMemberCollectionResponseDocument": { "required": [ - "data", - "links" - ], - "type": "object", - "properties": { - "jsonapi": { - "allOf": [ - { - "$ref": "#/components/schemas/Jsonapi" - } - ] - }, - "links": { - "allOf": [ - { - "$ref": "#/components/schemas/ResourceCollectionTopLevelLinks" - } - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/StaffMemberDataInResponse" - } - }, - "included": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataInResponse" - } - }, - "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } - } - }, - "additionalProperties": false - }, - "StaffMemberDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/StaffMemberResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/StaffMemberAttributesInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "StaffMemberDataInPostRequest": { - "required": [ - "type" + "data", + "links" ], "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/StaffMemberResourceType" + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/Jsonapi" + } + ] }, - "attributes": { + "links": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberAttributesInPostRequest" + "$ref": "#/components/schemas/ResourceCollectionTopLevelLinks" } ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StaffMemberDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataInResponse" + } + }, + "meta": { + "type": "object", + "additionalProperties": { + "type": "object", + "nullable": true + } } }, "additionalProperties": false @@ -3187,38 +3368,6 @@ }, "additionalProperties": false }, - "StaffMemberPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/StaffMemberDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "StaffMemberPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/StaffMemberDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "StaffMemberPrimaryResponseDocument": { "required": [ "data", @@ -3314,41 +3463,6 @@ }, "additionalProperties": false }, - "SupermarketAttributesInPatchRequest": { - "type": "object", - "properties": { - "NameOfCity": { - "type": "string" - }, - "Kind": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketType" - } - ] - } - }, - "additionalProperties": false - }, - "SupermarketAttributesInPostRequest": { - "required": [ - "NameOfCity" - ], - "type": "object", - "properties": { - "NameOfCity": { - "type": "string" - }, - "Kind": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketType" - } - ] - } - }, - "additionalProperties": false - }, "SupermarketAttributesInResponse": { "type": "object", "properties": { @@ -3408,63 +3522,6 @@ }, "additionalProperties": false }, - "SupermarketDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/SupermarketResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "SupermarketDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/SupermarketResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "SupermarketDataInResponse": { "allOf": [ { @@ -3507,38 +3564,6 @@ ], "additionalProperties": false }, - "SupermarketPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "SupermarketPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/SupermarketDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "SupermarketPrimaryResponseDocument": { "required": [ "data", @@ -3583,63 +3608,6 @@ }, "additionalProperties": false }, - "SupermarketRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "StoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/ToOneStaffMemberInRequest" - } - ] - }, - "BackupStoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableToOneStaffMemberInRequest" - } - ] - }, - "Cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/ToManyStaffMemberInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "SupermarketRelationshipsInPostRequest": { - "required": [ - "StoreManager" - ], - "type": "object", - "properties": { - "StoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/ToOneStaffMemberInRequest" - } - ] - }, - "BackupStoreManager": { - "allOf": [ - { - "$ref": "#/components/schemas/NullableToOneStaffMemberInRequest" - } - ] - }, - "Cashiers": { - "allOf": [ - { - "$ref": "#/components/schemas/ToManyStaffMemberInRequest" - } - ] - } - }, - "additionalProperties": false - }, "SupermarketRelationshipsInResponse": { "type": "object", "properties": { @@ -3765,6 +3733,38 @@ } }, "additionalProperties": false + }, + "UpdateStaffMemberRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + }, + "UpdateSupermarketRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs index 3646ff225a..262fc025e1 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs @@ -142,9 +142,9 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; }); - schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum[0]").With(enumValueElement => + schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => { - enumValueElement.Should().Be("StaffMembers"); + codeElement.Should().ContainArrayElement("StaffMembers"); }); }); } @@ -380,7 +380,7 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("SupermarketPostRequestDocument").SchemaReferenceId; + .ShouldBeSchemaReferenceId("CreateSupermarketRequestDocument").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -389,18 +389,18 @@ public async Task Casing_convention_is_applied_to_Post_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { - resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketDataInPostRequest") - .SchemaReferenceId; + resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") + .ShouldBeSchemaReferenceId("DataInCreateSupermarketRequest").SchemaReferenceId; }); string? resourceRelationshipInPostRequestSchemaRefId = null; schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketAttributesInPostRequest"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("AttributesInCreateSupermarketRequest"); resourceRelationshipInPostRequestSchemaRefId = propertiesElement.Should().ContainPath("relationships.allOf[0].$ref") - .ShouldBeSchemaReferenceId("SupermarketRelationshipsInPostRequest").SchemaReferenceId; + .ShouldBeSchemaReferenceId("RelationshipsInCreateSupermarketRequest").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceRelationshipInPostRequestSchemaRefId}.properties").With(propertiesElement => @@ -450,7 +450,7 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() }); documentSchemaRefId = getElement.Should().ContainPath("requestBody.content['application/vnd.api+json'].schema.allOf[0].$ref") - .ShouldBeSchemaReferenceId("SupermarketPatchRequestDocument").SchemaReferenceId; + .ShouldBeSchemaReferenceId("UpdateSupermarketRequestDocument").SchemaReferenceId; }); document.Should().ContainPath("components.schemas").With(schemasElement => @@ -460,13 +460,13 @@ public async Task Casing_convention_is_applied_to_Patch_endpoint() schemasElement.Should().ContainPath($"{documentSchemaRefId}.properties").With(propertiesElement => { resourceDataSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("SupermarketDataInPatchRequest").SchemaReferenceId; + .ShouldBeSchemaReferenceId("DataInUpdateSupermarketRequest").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{resourceDataSchemaRefId}.properties").With(propertiesElement => { - propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketAttributesInPatchRequest"); - propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketRelationshipsInPatchRequest"); + propertiesElement.Should().ContainPath("attributes.allOf[0].$ref").ShouldBeSchemaReferenceId("AttributesInUpdateSupermarketRequest"); + propertiesElement.Should().ContainPath("relationships.allOf[0].$ref").ShouldBeSchemaReferenceId("RelationshipsInUpdateSupermarketRequest"); }); }); } diff --git a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json index 54ad046fdc..6c472a857b 100644 --- a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/nameValuePairPostRequestDocument" + "$ref": "#/components/schemas/createNameValuePairRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/nameValuePairPatchRequestDocument" + "$ref": "#/components/schemas/updateNameValuePairRequestDocument" } ] } @@ -1159,7 +1159,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/nodePostRequestDocument" + "$ref": "#/components/schemas/createNodeRequestDocument" } ] } @@ -1454,7 +1454,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/nodePatchRequestDocument" + "$ref": "#/components/schemas/updateNodeRequestDocument" } ] } @@ -3075,6 +3075,148 @@ }, "components": { "schemas": { + "attributesInCreateNameValuePairRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInCreateNodeRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "comment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateNameValuePairRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateNodeRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "comment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "createNameValuePairRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateNameValuePairRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createNodeRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateNodeRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateNameValuePairRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/nameValuePairResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateNameValuePairRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateNameValuePairRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateNodeRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/nodeResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateNodeRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateNodeRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -3101,6 +3243,68 @@ }, "x-abstract": true }, + "dataInUpdateNameValuePairRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/nameValuePairResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateNameValuePairRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateNameValuePairRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateNodeRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/nodeResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateNodeRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateNodeRequest" + } + ] + } + }, + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -3221,35 +3425,6 @@ }, "additionalProperties": false }, - "nameValuePairAttributesInPatchRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "nameValuePairAttributesInPostRequest": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, "nameValuePairAttributesInResponse": { "type": "object", "properties": { @@ -3299,63 +3474,6 @@ }, "additionalProperties": false }, - "nameValuePairDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/nameValuePairResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nameValuePairDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/nameValuePairResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "nameValuePairDataInResponse": { "allOf": [ { @@ -3445,38 +3563,6 @@ }, "additionalProperties": false }, - "nameValuePairPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nameValuePairPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/nameValuePairDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "nameValuePairPrimaryResponseDocument": { "required": [ "data", @@ -3514,35 +3600,6 @@ }, "additionalProperties": false }, - "nameValuePairRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "owner": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneNodeInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nameValuePairRelationshipsInPostRequest": { - "required": [ - "owner" - ], - "type": "object", - "properties": { - "owner": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneNodeInRequest" - } - ] - } - }, - "additionalProperties": false - }, "nameValuePairRelationshipsInResponse": { "type": "object", "properties": { @@ -3550,46 +3607,17 @@ "allOf": [ { "$ref": "#/components/schemas/toOneNodeInResponse" - } - ] - } - }, - "additionalProperties": false - }, - "nameValuePairResourceType": { - "enum": [ - "nameValuePairs" - ], - "type": "string", - "additionalProperties": false - }, - "nodeAttributesInPatchRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "comment": { - "type": "string", - "nullable": true + } + ] } }, "additionalProperties": false }, - "nodeAttributesInPostRequest": { - "required": [ - "name" + "nameValuePairResourceType": { + "enum": [ + "nameValuePairs" ], - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "comment": { - "type": "string", - "nullable": true - } - }, + "type": "string", "additionalProperties": false }, "nodeAttributesInResponse": { @@ -3641,63 +3669,6 @@ }, "additionalProperties": false }, - "nodeDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/nodeResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nodeDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/nodeResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "nodeDataInResponse": { "allOf": [ { @@ -3818,38 +3789,6 @@ }, "additionalProperties": false }, - "nodePatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nodePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/nodeDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "nodePrimaryResponseDocument": { "required": [ "data", @@ -3887,60 +3826,6 @@ }, "additionalProperties": false }, - "nodeRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "values": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyNameValuePairInRequest" - } - ] - }, - "parent": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneNodeInRequest" - } - ] - }, - "children": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyNodeInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "nodeRelationshipsInPostRequest": { - "type": "object", - "properties": { - "values": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyNameValuePairInRequest" - } - ] - }, - "parent": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneNodeInRequest" - } - ] - }, - "children": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyNodeInRequest" - } - ] - } - }, - "additionalProperties": false - }, "nodeRelationshipsInResponse": { "type": "object", "properties": { @@ -4139,6 +4024,89 @@ }, "additionalProperties": false }, + "relationshipsInCreateNameValuePairRequest": { + "required": [ + "owner" + ], + "type": "object", + "properties": { + "owner": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneNodeInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreateNodeRequest": { + "type": "object", + "properties": { + "values": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyNameValuePairInRequest" + } + ] + }, + "parent": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneNodeInRequest" + } + ] + }, + "children": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyNodeInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateNameValuePairRequest": { + "type": "object", + "properties": { + "owner": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneNodeInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateNodeRequest": { + "type": "object", + "properties": { + "values": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyNameValuePairInRequest" + } + ] + }, + "parent": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneNodeInRequest" + } + ] + }, + "children": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyNodeInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -4350,6 +4318,38 @@ } }, "additionalProperties": false + }, + "updateNameValuePairRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateNameValuePairRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateNodeRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateNodeRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index f3714fc69b..1ffbb52ffd 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePostRequestDocument" + "$ref": "#/components/schemas/createResourceRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePatchRequestDocument" + "$ref": "#/components/schemas/updateResourceRequestDocument" } ] } @@ -2512,6 +2512,119 @@ }, "components": { "schemas": { + "attributesInCreateResourceRequest": { + "required": [ + "requiredNullableValueType", + "requiredReferenceType", + "requiredValueType" + ], + "type": "object", + "properties": { + "referenceType": { + "type": "string", + "nullable": true + }, + "requiredReferenceType": { + "minLength": 1, + "type": "string", + "nullable": true + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateResourceRequest": { + "type": "object", + "properties": { + "referenceType": { + "type": "string", + "nullable": true + }, + "requiredReferenceType": { + "minLength": 1, + "type": "string", + "nullable": true + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "createResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateResourceRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -2538,6 +2651,37 @@ }, "x-abstract": true }, + "dataInUpdateResourceRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "emptyCollectionResponseDocument": { "required": [ "data", @@ -2903,73 +3047,74 @@ }, "additionalProperties": false }, - "resourceAttributesInPatchRequest": { + "relationshipsInCreateResourceRequest": { + "required": [ + "requiredToMany", + "requiredToOne" + ], "type": "object", "properties": { - "referenceType": { - "type": "string", - "nullable": true - }, - "requiredReferenceType": { - "minLength": 1, - "type": "string", - "nullable": true - }, - "valueType": { - "type": "integer", - "format": "int32" + "toOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false }, - "resourceAttributesInPostRequest": { - "required": [ - "requiredNullableValueType", - "requiredReferenceType", - "requiredValueType" - ], + "relationshipsInUpdateResourceRequest": { "type": "object", "properties": { - "referenceType": { - "type": "string", - "nullable": true - }, - "requiredReferenceType": { - "minLength": 1, - "type": "string", - "nullable": true - }, - "valueType": { - "type": "integer", - "format": "int32" + "toOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false @@ -3067,63 +3212,6 @@ }, "additionalProperties": false }, - "resourceDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceDataInResponse": { "allOf": [ { @@ -3217,38 +3305,6 @@ }, "additionalProperties": false }, - "resourcePatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourcePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourcePrimaryResponseDocument": { "required": [ "data", @@ -3286,78 +3342,6 @@ }, "additionalProperties": false }, - "resourceRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "toOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceRelationshipsInPostRequest": { - "required": [ - "requiredToMany", - "requiredToOne" - ], - "type": "object", - "properties": { - "toOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceRelationshipsInResponse": { "type": "object", "properties": { @@ -3451,6 +3435,22 @@ } }, "additionalProperties": false + }, + "updateResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs index 62542f832d..41c174770d 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs @@ -64,7 +64,7 @@ public async Task Schema_property_for_relationship_is_nullable(string jsonProper JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { @@ -85,7 +85,7 @@ public async Task Schema_property_for_relationship_is_not_nullable(string jsonPr JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/RequiredTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/RequiredTests.cs index b834f351e0..075801fba8 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/RequiredTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/RequiredTests.cs @@ -25,7 +25,7 @@ public async Task Schema_property_for_attribute_is_required_for_creating_resourc JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -42,7 +42,7 @@ public async Task Schema_property_for_attribute_is_not_required_for_creating_res JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); @@ -58,7 +58,7 @@ public async Task Schema_property_for_relationship_is_required_for_creating_reso JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -74,7 +74,7 @@ public async Task Schema_property_for_relationship_is_not_required_for_creating_ JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index a395b78d1d..40053fa6d2 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePostRequestDocument" + "$ref": "#/components/schemas/createResourceRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePatchRequestDocument" + "$ref": "#/components/schemas/updateResourceRequestDocument" } ] } @@ -2512,6 +2512,114 @@ }, "components": { "schemas": { + "attributesInCreateResourceRequest": { + "required": [ + "requiredNullableValueType", + "requiredReferenceType" + ], + "type": "object", + "properties": { + "referenceType": { + "type": "string", + "nullable": true + }, + "requiredReferenceType": { + "minLength": 1, + "type": "string" + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributesInUpdateResourceRequest": { + "type": "object", + "properties": { + "referenceType": { + "type": "string", + "nullable": true + }, + "requiredReferenceType": { + "minLength": 1, + "type": "string" + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "createResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateResourceRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -2538,6 +2646,37 @@ }, "x-abstract": true }, + "dataInUpdateResourceRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "emptyCollectionResponseDocument": { "required": [ "data", @@ -2971,68 +3110,73 @@ }, "additionalProperties": false }, - "resourceAttributesInPatchRequest": { + "relationshipsInCreateResourceRequest": { + "required": [ + "requiredToOne" + ], "type": "object", "properties": { - "referenceType": { - "type": "string", - "nullable": true - }, - "requiredReferenceType": { - "minLength": 1, - "type": "string" - }, - "valueType": { - "type": "integer", - "format": "int32" + "toOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32" + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false }, - "resourceAttributesInPostRequest": { - "required": [ - "requiredNullableValueType", - "requiredReferenceType" - ], + "relationshipsInUpdateResourceRequest": { "type": "object", "properties": { - "referenceType": { - "type": "string", - "nullable": true - }, - "requiredReferenceType": { - "minLength": 1, - "type": "string" - }, - "valueType": { - "type": "integer", - "format": "int32" + "toOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32" + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false @@ -3128,63 +3272,6 @@ }, "additionalProperties": false }, - "resourceDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceDataInResponse": { "allOf": [ { @@ -3278,38 +3365,6 @@ }, "additionalProperties": false }, - "resourcePatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourcePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourcePrimaryResponseDocument": { "required": [ "data", @@ -3347,77 +3402,6 @@ }, "additionalProperties": false }, - "resourceRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "toOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceRelationshipsInPostRequest": { - "required": [ - "requiredToOne" - ], - "type": "object", - "properties": { - "toOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceRelationshipsInResponse": { "type": "object", "properties": { @@ -3554,6 +3538,22 @@ } }, "additionalProperties": false + }, + "updateResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs index 6602577442..f6214ee6eb 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs @@ -63,7 +63,7 @@ public async Task Schema_property_for_relationship_is_nullable(string jsonProper JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { @@ -85,7 +85,7 @@ public async Task Schema_property_for_relationship_is_not_nullable(string jsonPr JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/RequiredTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/RequiredTests.cs index ee6f46cd1d..b0b9ab01f3 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/RequiredTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/RequiredTests.cs @@ -24,7 +24,7 @@ public async Task Schema_property_for_attribute_is_required_for_creating_resourc JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -42,7 +42,7 @@ public async Task Schema_property_for_attribute_is_not_required_for_creating_res JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); @@ -57,7 +57,7 @@ public async Task Schema_property_for_relationship_is_required_for_creating_reso JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -74,7 +74,7 @@ public async Task Schema_property_for_relationship_is_not_required_for_creating_ JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index e2943dc939..4e13603859 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePostRequestDocument" + "$ref": "#/components/schemas/createResourceRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePatchRequestDocument" + "$ref": "#/components/schemas/updateResourceRequestDocument" } ] } @@ -3344,6 +3344,134 @@ }, "components": { "schemas": { + "attributesInCreateResourceRequest": { + "required": [ + "requiredNonNullableReferenceType", + "requiredNullableReferenceType", + "requiredNullableValueType", + "requiredValueType" + ], + "type": "object", + "properties": { + "nonNullableReferenceType": { + "type": "string" + }, + "requiredNonNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "nullableReferenceType": { + "type": "string", + "nullable": true + }, + "requiredNullableReferenceType": { + "minLength": 1, + "type": "string", + "nullable": true + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateResourceRequest": { + "type": "object", + "properties": { + "nonNullableReferenceType": { + "type": "string" + }, + "requiredNonNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "nullableReferenceType": { + "type": "string", + "nullable": true + }, + "requiredNullableReferenceType": { + "minLength": 1, + "type": "string", + "nullable": true + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "createResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateResourceRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -3370,6 +3498,37 @@ }, "x-abstract": true }, + "dataInUpdateResourceRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "emptyCollectionResponseDocument": { "required": [ "data", @@ -3803,88 +3962,103 @@ }, "additionalProperties": false }, - "resourceAttributesInPatchRequest": { + "relationshipsInCreateResourceRequest": { + "required": [ + "requiredNonNullableToOne", + "requiredNullableToOne", + "requiredToMany" + ], "type": "object", "properties": { - "nonNullableReferenceType": { - "type": "string" - }, - "requiredNonNullableReferenceType": { - "minLength": 1, - "type": "string" - }, - "nullableReferenceType": { - "type": "string", - "nullable": true + "nonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "requiredNullableReferenceType": { - "minLength": 1, - "type": "string", - "nullable": true + "requiredNonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "valueType": { - "type": "integer", - "format": "int32" + "nullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false }, - "resourceAttributesInPostRequest": { - "required": [ - "requiredNonNullableReferenceType", - "requiredNullableReferenceType", - "requiredNullableValueType", - "requiredValueType" - ], + "relationshipsInUpdateResourceRequest": { "type": "object", "properties": { - "nonNullableReferenceType": { - "type": "string" - }, - "requiredNonNullableReferenceType": { - "minLength": 1, - "type": "string" - }, - "nullableReferenceType": { - "type": "string", - "nullable": true + "nonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "requiredNullableReferenceType": { - "minLength": 1, - "type": "string", - "nullable": true + "requiredNonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "valueType": { - "type": "integer", - "format": "int32" + "nullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false @@ -3989,63 +4163,6 @@ }, "additionalProperties": false }, - "resourceDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceDataInResponse": { "allOf": [ { @@ -4139,38 +4256,6 @@ }, "additionalProperties": false }, - "resourcePatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourcePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourcePrimaryResponseDocument": { "required": [ "data", @@ -4208,107 +4293,6 @@ }, "additionalProperties": false }, - "resourceRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "nonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "requiredNonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "nullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceRelationshipsInPostRequest": { - "required": [ - "requiredNonNullableToOne", - "requiredNullableToOne", - "requiredToMany" - ], - "type": "object", - "properties": { - "nonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "requiredNonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "nullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceRelationshipsInResponse": { "type": "object", "properties": { @@ -4459,6 +4443,22 @@ } }, "additionalProperties": false + }, + "updateResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs index cb539f078e..9ae0cb4bd4 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs @@ -66,7 +66,7 @@ public async Task Schema_property_for_relationship_is_nullable(string jsonProper JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { @@ -89,7 +89,7 @@ public async Task Schema_property_for_relationship_is_not_nullable(string jsonPr JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/RequiredTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/RequiredTests.cs index 536bcb3456..033c65c7b1 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/RequiredTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/RequiredTests.cs @@ -26,7 +26,7 @@ public async Task Schema_property_for_attribute_is_required_for_creating_resourc JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -44,7 +44,7 @@ public async Task Schema_property_for_attribute_is_not_required_for_creating_res JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); @@ -61,7 +61,7 @@ public async Task Schema_property_for_relationship_is_required_for_creating_reso JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -78,7 +78,7 @@ public async Task Schema_property_for_relationship_is_not_required_for_creating_ JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 5dbc8dc824..5c8d867f31 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -180,7 +180,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePostRequestDocument" + "$ref": "#/components/schemas/createResourceRequestDocument" } ] } @@ -475,7 +475,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/resourcePatchRequestDocument" + "$ref": "#/components/schemas/updateResourceRequestDocument" } ] } @@ -3344,6 +3344,130 @@ }, "components": { "schemas": { + "attributesInCreateResourceRequest": { + "required": [ + "nonNullableReferenceType", + "requiredNonNullableReferenceType", + "requiredNullableReferenceType", + "requiredNullableValueType" + ], + "type": "object", + "properties": { + "nonNullableReferenceType": { + "type": "string" + }, + "requiredNonNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "nullableReferenceType": { + "type": "string", + "nullable": true + }, + "requiredNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "attributesInUpdateResourceRequest": { + "type": "object", + "properties": { + "nonNullableReferenceType": { + "type": "string" + }, + "requiredNonNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "nullableReferenceType": { + "type": "string", + "nullable": true + }, + "requiredNullableReferenceType": { + "minLength": 1, + "type": "string" + }, + "valueType": { + "type": "integer", + "format": "int32" + }, + "requiredValueType": { + "type": "integer", + "format": "int32" + }, + "nullableValueType": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "requiredNullableValueType": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "createResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateResourceRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -3370,6 +3494,37 @@ }, "x-abstract": true }, + "dataInUpdateResourceRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/resourceResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateResourceRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false + }, "emptyCollectionResponseDocument": { "required": [ "data", @@ -3803,84 +3958,103 @@ }, "additionalProperties": false }, - "resourceAttributesInPatchRequest": { + "relationshipsInCreateResourceRequest": { + "required": [ + "nonNullableToOne", + "requiredNonNullableToOne", + "requiredNullableToOne" + ], "type": "object", "properties": { - "nonNullableReferenceType": { - "type": "string" - }, - "requiredNonNullableReferenceType": { - "minLength": 1, - "type": "string" - }, - "nullableReferenceType": { - "type": "string", - "nullable": true + "nonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "requiredNullableReferenceType": { - "minLength": 1, - "type": "string" + "requiredNonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "valueType": { - "type": "integer", - "format": "int32" + "nullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32" + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false }, - "resourceAttributesInPostRequest": { - "required": [ - "nonNullableReferenceType", - "requiredNonNullableReferenceType", - "requiredNullableReferenceType", - "requiredNullableValueType" - ], + "relationshipsInUpdateResourceRequest": { "type": "object", "properties": { - "nonNullableReferenceType": { - "type": "string" - }, - "requiredNonNullableReferenceType": { - "minLength": 1, - "type": "string" - }, - "nullableReferenceType": { - "type": "string", - "nullable": true + "nonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "requiredNullableReferenceType": { - "minLength": 1, - "type": "string" + "requiredNonNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "valueType": { - "type": "integer", - "format": "int32" + "nullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneEmptyInRequest" + } + ] }, - "requiredValueType": { - "type": "integer", - "format": "int32" + "requiredNullableToOne": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneEmptyInRequest" + } + ] }, - "nullableValueType": { - "type": "integer", - "format": "int32", - "nullable": true + "toMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] }, - "requiredNullableValueType": { - "type": "integer", - "format": "int32" + "requiredToMany": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEmptyInRequest" + } + ] } }, "additionalProperties": false @@ -3983,63 +4157,6 @@ }, "additionalProperties": false }, - "resourceDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/resourceResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceDataInResponse": { "allOf": [ { @@ -4133,38 +4250,6 @@ }, "additionalProperties": false }, - "resourcePatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourcePostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/resourceDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourcePrimaryResponseDocument": { "required": [ "data", @@ -4202,107 +4287,6 @@ }, "additionalProperties": false }, - "resourceRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "nonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "requiredNonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "nullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "resourceRelationshipsInPostRequest": { - "required": [ - "nonNullableToOne", - "requiredNonNullableToOne", - "requiredNullableToOne" - ], - "type": "object", - "properties": { - "nonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "requiredNonNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "nullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneEmptyInRequest" - } - ] - }, - "requiredNullableToOne": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneEmptyInRequest" - } - ] - }, - "toMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - }, - "requiredToMany": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyEmptyInRequest" - } - ] - } - }, - "additionalProperties": false - }, "resourceRelationshipsInResponse": { "type": "object", "properties": { @@ -4453,6 +4437,22 @@ } }, "additionalProperties": false + }, + "updateResourceRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateResourceRequest" + } + ] + } + }, + "additionalProperties": false } } } diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs index 3f75d23a31..f594219cff 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs @@ -65,7 +65,7 @@ public async Task Schema_property_for_relationship_is_nullable(string jsonProper JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { @@ -89,7 +89,7 @@ public async Task Schema_property_for_relationship_is_not_nullable(string jsonPr JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest.properties").With(schemaProperties => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest.properties").With(schemaProperties => { schemaProperties.Should().ContainPath($"{jsonPropertyName}.allOf[0].$ref").WithSchemaReferenceId(schemaReferenceId => { diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/RequiredTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/RequiredTests.cs index c2010167bb..1e3b9cd39e 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/RequiredTests.cs +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/RequiredTests.cs @@ -26,7 +26,7 @@ public async Task Schema_property_for_attribute_is_required_for_creating_resourc JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -44,7 +44,7 @@ public async Task Schema_property_for_attribute_is_not_required_for_creating_res JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceAttributesInPostRequest").With(attributesSchema => + document.Should().ContainPath("components.schemas.attributesInCreateResourceRequest").With(attributesSchema => { attributesSchema.Should().ContainPath($"properties.{jsonPropertyName}"); attributesSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); @@ -61,7 +61,7 @@ public async Task Schema_property_for_relationship_is_required_for_creating_reso JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().ContainArrayElement(jsonPropertyName)); @@ -78,7 +78,7 @@ public async Task Schema_property_for_relationship_is_not_required_for_creating_ JsonElement document = await _testContext.GetSwaggerDocumentAsync(); // Assert - document.Should().ContainPath("components.schemas.resourceRelationshipsInPostRequest").With(relationshipsSchema => + document.Should().ContainPath("components.schemas.relationshipsInCreateResourceRequest").With(relationshipsSchema => { relationshipsSchema.Should().ContainPath($"properties.{jsonPropertyName}"); relationshipsSchema.Should().ContainPath("required").With(propertySet => propertySet.Should().NotContainArrayElement(jsonPropertyName)); diff --git a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json index fc15aeb53d..00956aebe2 100644 --- a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json @@ -3418,7 +3418,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/writeOnlyChannelPostRequestDocument" + "$ref": "#/components/schemas/createWriteOnlyChannelRequestDocument" } ] } @@ -3541,7 +3541,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/writeOnlyChannelPatchRequestDocument" + "$ref": "#/components/schemas/updateWriteOnlyChannelRequestDocument" } ] } @@ -3988,6 +3988,84 @@ }, "components": { "schemas": { + "attributesInCreateWriteOnlyChannelRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "isCommercial": { + "type": "boolean", + "nullable": true + }, + "isAdultOnly": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateWriteOnlyChannelRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "isCommercial": { + "type": "boolean", + "nullable": true + }, + "isAdultOnly": { + "type": "boolean", + "nullable": true + } + }, + "additionalProperties": false + }, + "createWriteOnlyChannelRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateWriteOnlyChannelRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateWriteOnlyChannelRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/writeOnlyChannelResourceType" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateWriteOnlyChannelRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateWriteOnlyChannelRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataInResponse": { "required": [ "id", @@ -4016,6 +4094,37 @@ }, "x-abstract": true }, + "dataInUpdateWriteOnlyChannelRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/writeOnlyChannelResourceType" + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateWriteOnlyChannelRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateWriteOnlyChannelRequest" + } + ] + } + }, + "additionalProperties": false + }, "dataStreamAttributesInResponse": { "type": "object", "properties": { @@ -4823,6 +4932,63 @@ }, "additionalProperties": false }, + "relationshipsInCreateWriteOnlyChannelRequest": { + "required": [ + "videoStream" + ], + "type": "object", + "properties": { + "videoStream": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneDataStreamInRequest" + } + ] + }, + "ultraHighDefinitionVideoStream": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneDataStreamInRequest" + } + ] + }, + "audioStreams": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyDataStreamInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateWriteOnlyChannelRequest": { + "type": "object", + "properties": { + "videoStream": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneDataStreamInRequest" + } + ] + }, + "ultraHighDefinitionVideoStream": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneDataStreamInRequest" + } + ] + }, + "audioStreams": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyDataStreamInRequest" + } + ] + } + }, + "additionalProperties": false + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -4994,38 +5160,18 @@ }, "additionalProperties": false }, - "writeOnlyChannelAttributesInPatchRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "isCommercial": { - "type": "boolean", - "nullable": true - }, - "isAdultOnly": { - "type": "boolean", - "nullable": true - } - }, - "additionalProperties": false - }, - "writeOnlyChannelAttributesInPostRequest": { + "updateWriteOnlyChannelRequestDocument": { + "required": [ + "data" + ], "type": "object", "properties": { - "name": { - "type": "string", - "nullable": true - }, - "isCommercial": { - "type": "boolean", - "nullable": true - }, - "isAdultOnly": { - "type": "boolean", - "nullable": true + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateWriteOnlyChannelRequest" + } + ] } }, "additionalProperties": false @@ -5048,63 +5194,6 @@ }, "additionalProperties": false }, - "writeOnlyChannelDataInPatchRequest": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/writeOnlyChannelResourceType" - }, - "id": { - "minLength": 1, - "type": "string" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelAttributesInPatchRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelRelationshipsInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "writeOnlyChannelDataInPostRequest": { - "required": [ - "type" - ], - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/writeOnlyChannelResourceType" - }, - "attributes": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelAttributesInPostRequest" - } - ] - }, - "relationships": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelRelationshipsInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "writeOnlyChannelDataInResponse": { "allOf": [ { @@ -5147,38 +5236,6 @@ ], "additionalProperties": false }, - "writeOnlyChannelPatchRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelDataInPatchRequest" - } - ] - } - }, - "additionalProperties": false - }, - "writeOnlyChannelPostRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/writeOnlyChannelDataInPostRequest" - } - ] - } - }, - "additionalProperties": false - }, "writeOnlyChannelPrimaryResponseDocument": { "required": [ "data", @@ -5216,63 +5273,6 @@ }, "additionalProperties": false }, - "writeOnlyChannelRelationshipsInPatchRequest": { - "type": "object", - "properties": { - "videoStream": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneDataStreamInRequest" - } - ] - }, - "ultraHighDefinitionVideoStream": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneDataStreamInRequest" - } - ] - }, - "audioStreams": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyDataStreamInRequest" - } - ] - } - }, - "additionalProperties": false - }, - "writeOnlyChannelRelationshipsInPostRequest": { - "required": [ - "videoStream" - ], - "type": "object", - "properties": { - "videoStream": { - "allOf": [ - { - "$ref": "#/components/schemas/toOneDataStreamInRequest" - } - ] - }, - "ultraHighDefinitionVideoStream": { - "allOf": [ - { - "$ref": "#/components/schemas/nullableToOneDataStreamInRequest" - } - ] - }, - "audioStreams": { - "allOf": [ - { - "$ref": "#/components/schemas/toManyDataStreamInRequest" - } - ] - } - }, - "additionalProperties": false - }, "writeOnlyChannelRelationshipsInResponse": { "type": "object", "properties": { From 9f8f761b8ea7a70ab813113a31e157a70f6ae7a5 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 10:29:40 +0200 Subject: [PATCH 2/7] Update kiota version --- .config/dotnet-tools.json | 17 ++- .../GeneratedCode/Api/ApiRequestBuilder.cs | 21 +-- .../AssignedTodoItemsRequestBuilder.cs | 43 +++--- .../OwnedTodoItemsRequestBuilder.cs | 43 +++--- .../People/Item/PeopleItemRequestBuilder.cs | 87 +++++------ .../AssignedTodoItemsRequestBuilder.cs | 103 ++++++------- .../OwnedTodoItemsRequestBuilder.cs | 103 ++++++------- .../RelationshipsRequestBuilder.cs | 17 ++- .../Api/People/PeopleRequestBuilder.cs | 77 +++++----- .../RelationshipsRequestBuilder.cs | 13 +- .../TodoItems/TodoItemsRequestBuilder.cs | 103 ++++++------- .../Api/Tags/Item/TagsItemRequestBuilder.cs | 83 +++++----- .../Item/TodoItems/TodoItemsRequestBuilder.cs | 43 +++--- .../Api/Tags/TagsRequestBuilder.cs | 77 +++++----- .../Item/Assignee/AssigneeRequestBuilder.cs | 43 +++--- .../Item/Owner/OwnerRequestBuilder.cs | 43 +++--- .../Assignee/AssigneeRequestBuilder.cs | 63 ++++---- .../Owner/OwnerRequestBuilder.cs | 63 ++++---- .../RelationshipsRequestBuilder.cs | 21 +-- .../Relationships/Tags/TagsRequestBuilder.cs | 103 ++++++------- .../TodoItems/Item/Tags/TagsRequestBuilder.cs | 43 +++--- .../Item/TodoItemsItemRequestBuilder.cs | 91 +++++------ .../Api/TodoItems/TodoItemsRequestBuilder.cs | 77 +++++----- .../GeneratedCode/ExampleApiClient.cs | 11 +- .../GeneratedCode/Models/Assignee.cs | 106 ------------- .../GeneratedCode/Models/Assignee_meta.cs | 58 ------- .../Models/AttributesInCreatePersonRequest.cs | 29 ++-- .../Models/AttributesInCreateTagRequest.cs | 21 +-- .../AttributesInCreateTodoItemRequest.cs | 35 +++-- .../Models/AttributesInUpdatePersonRequest.cs | 29 ++-- .../Models/AttributesInUpdateTagRequest.cs | 21 +-- .../AttributesInUpdateTodoItemRequest.cs | 35 +++-- .../Models/CreatePersonRequestDocument.cs | 27 ++-- .../Models/CreateTagRequestDocument.cs | 27 ++-- .../Models/CreateTodoItemRequestDocument.cs | 27 ++-- .../Models/DataInCreatePersonRequest.cs | 50 +++--- .../Models/DataInCreateTagRequest.cs | 50 +++--- .../Models/DataInCreateTodoItemRequest.cs | 50 +++--- .../GeneratedCode/Models/DataInResponse.cs | 35 +++-- .../Models/DataInUpdatePersonRequest.cs | 58 ++++--- .../Models/DataInUpdateTagRequest.cs | 58 ++++--- .../Models/DataInUpdateTodoItemRequest.cs | 58 ++++--- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- ...ullablePersonIdentifierResponseDocument.cs | 55 ++++--- ...lePersonIdentifierResponseDocument_meta.cs | 18 ++- ...NullablePersonSecondaryResponseDocument.cs | 69 +++++---- ...blePersonSecondaryResponseDocument_meta.cs | 18 ++- .../Models/NullableToOnePersonInRequest.cs | 27 ++-- .../Models/NullableToOnePersonInResponse.cs | 55 ++++--- .../NullableToOnePersonInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/Owner.cs | 106 ------------- .../GeneratedCode/Models/Owner_meta.cs | 58 ------- .../GeneratedCode/Models/People.cs | 106 ------------- .../GeneratedCode/Models/People_meta.cs | 58 ------- .../Models/PersonAttributesInResponse.cs | 37 +++-- .../PersonCollectionResponseDocument.cs | 69 +++++---- .../PersonCollectionResponseDocument_meta.cs | 18 ++- .../Models/PersonDataInResponse.cs | 67 +++++---- .../Models/PersonDataInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/PersonIdentifier.cs | 30 ++-- .../PersonIdentifierResponseDocument.cs | 55 ++++--- .../PersonIdentifierResponseDocument_meta.cs | 18 ++- .../Models/PersonPrimaryResponseDocument.cs | 69 +++++---- .../PersonPrimaryResponseDocument_meta.cs | 18 ++- .../Models/PersonRelationshipsInResponse.cs | 41 ++--- .../Models/PersonResourceType.cs | 3 +- .../Models/PersonSecondaryResponseDocument.cs | 69 +++++---- .../PersonSecondaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- .../RelationshipsInCreatePersonRequest.cs | 41 ++--- .../Models/RelationshipsInCreateTagRequest.cs | 27 ++-- .../RelationshipsInCreateTodoItemRequest.cs | 55 ++++--- .../RelationshipsInUpdatePersonRequest.cs | 41 ++--- .../Models/RelationshipsInUpdateTagRequest.cs | 27 ++-- .../RelationshipsInUpdateTodoItemRequest.cs | 55 ++++--- .../Models/ResourceCollectionTopLevelLinks.cs | 61 +++++--- ...sourceIdentifierCollectionTopLevelLinks.cs | 69 +++++---- .../Models/ResourceIdentifierTopLevelLinks.cs | 37 +++-- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/TagAttributesInResponse.cs | 21 +-- .../Models/TagCollectionResponseDocument.cs | 69 +++++---- .../TagCollectionResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/TagDataInResponse.cs | 67 +++++---- .../Models/TagDataInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/TagIdentifier.cs | 30 ++-- ...TagIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../Models/TagPrimaryResponseDocument.cs | 69 +++++---- .../Models/TagPrimaryResponseDocument_meta.cs | 18 ++- .../Models/TagRelationshipsInResponse.cs | 27 ++-- .../GeneratedCode/Models/TagResourceType.cs | 3 +- .../GeneratedCode/Models/Tags.cs | 106 ------------- .../GeneratedCode/Models/Tags_meta.cs | 58 ------- .../Models/ToManyTagInRequest.cs | 27 ++-- .../Models/ToManyTagInResponse.cs | 55 ++++--- .../Models/ToManyTagInResponse_meta.cs | 18 ++- .../Models/ToManyTodoItemInRequest.cs | 27 ++-- .../Models/ToManyTodoItemInResponse.cs | 55 ++++--- .../Models/ToManyTodoItemInResponse_meta.cs | 18 ++- .../Models/ToOnePersonInRequest.cs | 27 ++-- .../Models/ToOnePersonInResponse.cs | 55 ++++--- .../Models/ToOnePersonInResponse_meta.cs | 18 ++- .../Models/TodoItemAttributesInResponse.cs | 45 +++--- .../TodoItemCollectionResponseDocument.cs | 69 +++++---- ...TodoItemCollectionResponseDocument_meta.cs | 18 ++- .../Models/TodoItemDataInResponse.cs | 67 +++++---- .../Models/TodoItemDataInResponse_meta.cs | 18 ++- .../Models/TodoItemIdentifier.cs | 30 ++-- ...temIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../Models/TodoItemPrimaryResponseDocument.cs | 69 +++++---- .../TodoItemPrimaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/TodoItemPriority.cs | 3 +- .../Models/TodoItemRelationshipsInResponse.cs | 55 ++++--- .../Models/TodoItemResourceType.cs | 3 +- .../GeneratedCode/Models/TodoItems.cs | 106 ------------- .../GeneratedCode/Models/TodoItems_meta.cs | 58 ------- .../Models/UpdatePersonRequestDocument.cs | 27 ++-- .../Models/UpdateTagRequestDocument.cs | 27 ++-- .../Models/UpdateTodoItemRequestDocument.cs | 27 ++-- .../ClientIdGenerationModesClient.cs | 19 +-- .../Games/GamesRequestBuilder.cs | 43 +++--- .../Models/AttributesInCreateGameRequest.cs | 26 ++-- .../AttributesInCreatePlayerGroupRequest.cs | 21 +-- .../Models/AttributesInCreatePlayerRequest.cs | 21 +-- .../Models/CreateGameRequestDocument.cs | 27 ++-- .../CreatePlayerGroupRequestDocument.cs | 27 ++-- .../Models/CreatePlayerRequestDocument.cs | 27 ++-- .../Models/DataInCreateGameRequest.cs | 44 +++--- .../Models/DataInCreatePlayerGroupRequest.cs | 50 +++--- .../Models/DataInCreatePlayerRequest.cs | 58 ++++--- .../GeneratedCode/Models/DataInResponse.cs | 35 +++-- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- .../Models/GameAttributesInResponse.cs | 26 ++-- .../Models/GameDataInResponse.cs | 53 ++++--- .../Models/GameDataInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/GameIdentifier.cs | 30 ++-- .../Models/GamePrimaryResponseDocument.cs | 69 +++++---- .../GamePrimaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/GameResourceType.cs | 3 +- .../GeneratedCode/Models/Games.cs | 90 ----------- .../GeneratedCode/Models/Games_meta.cs | 58 ------- .../Models/PlayerAttributesInResponse.cs | 21 +-- .../Models/PlayerDataInResponse.cs | 67 +++++---- .../Models/PlayerDataInResponse_meta.cs | 18 ++- .../Models/PlayerGroupAttributesInResponse.cs | 21 +-- .../Models/PlayerGroupDataInResponse.cs | 67 +++++---- .../Models/PlayerGroupDataInResponse_meta.cs | 18 ++- .../Models/PlayerGroupIdentifier.cs | 30 ++-- .../PlayerGroupPrimaryResponseDocument.cs | 69 +++++---- ...PlayerGroupPrimaryResponseDocument_meta.cs | 18 ++- .../PlayerGroupRelationshipsInResponse.cs | 27 ++-- .../Models/PlayerGroupResourceType.cs | 3 +- .../GeneratedCode/Models/PlayerGroups.cs | 106 ------------- .../GeneratedCode/Models/PlayerGroups_meta.cs | 58 ------- .../GeneratedCode/Models/PlayerIdentifier.cs | 30 ++-- .../Models/PlayerPrimaryResponseDocument.cs | 69 +++++---- .../PlayerPrimaryResponseDocument_meta.cs | 18 ++- .../Models/PlayerRelationshipsInResponse.cs | 41 ++--- .../Models/PlayerResourceType.cs | 3 +- .../GeneratedCode/Models/Players.cs | 106 ------------- .../GeneratedCode/Models/Players_meta.cs | 58 ------- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- ...RelationshipsInCreatePlayerGroupRequest.cs | 27 ++-- .../RelationshipsInCreatePlayerRequest.cs | 41 ++--- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/ToManyGameInRequest.cs | 27 ++-- .../Models/ToManyGameInResponse.cs | 55 ++++--- .../Models/ToManyGameInResponse_meta.cs | 18 ++- .../Models/ToManyPlayerGroupInRequest.cs | 27 ++-- .../Models/ToManyPlayerGroupInResponse.cs | 55 ++++--- .../ToManyPlayerGroupInResponse_meta.cs | 18 ++- .../Models/ToManyPlayerInRequest.cs | 27 ++-- .../Models/ToManyPlayerInResponse.cs | 55 ++++--- .../Models/ToManyPlayerInResponse_meta.cs | 18 ++- .../PlayerGroupsRequestBuilder.cs | 47 +++--- .../Players/PlayersRequestBuilder.cs | 43 +++--- .../Countries/CountriesRequestBuilder.cs | 77 +++++----- .../Item/CountriesItemRequestBuilder.cs | 83 +++++----- .../Item/Languages/LanguagesRequestBuilder.cs | 43 +++--- .../Languages/LanguagesRequestBuilder.cs | 103 ++++++------- .../RelationshipsRequestBuilder.cs | 13 +- .../Headers/GeneratedCode/HeadersClient.cs | 11 +- .../AttributesInCreateCountryRequest.cs | 26 ++-- .../AttributesInUpdateCountryRequest.cs | 26 ++-- .../Headers/GeneratedCode/Models/Countries.cs | 106 ------------- .../GeneratedCode/Models/Countries_meta.cs | 58 ------- .../Models/CountryAttributesInResponse.cs | 26 ++-- .../CountryCollectionResponseDocument.cs | 69 +++++---- .../CountryCollectionResponseDocument_meta.cs | 18 ++- .../Models/CountryDataInResponse.cs | 67 +++++---- .../Models/CountryDataInResponse_meta.cs | 18 ++- .../Models/CountryPrimaryResponseDocument.cs | 69 +++++---- .../CountryPrimaryResponseDocument_meta.cs | 18 ++- .../Models/CountryRelationshipsInResponse.cs | 27 ++-- .../Models/CountryResourceType.cs | 3 +- .../Models/CreateCountryRequestDocument.cs | 27 ++-- .../Models/DataInCreateCountryRequest.cs | 50 +++--- .../GeneratedCode/Models/DataInResponse.cs | 33 ++-- .../Models/DataInUpdateCountryRequest.cs | 58 ++++--- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- .../Models/LanguageAttributesInResponse.cs | 29 ++-- .../LanguageCollectionResponseDocument.cs | 69 +++++---- ...LanguageCollectionResponseDocument_meta.cs | 18 ++- .../Models/LanguageDataInResponse.cs | 53 ++++--- .../Models/LanguageDataInResponse_meta.cs | 18 ++- .../Models/LanguageIdentifier.cs | 30 ++-- ...ageIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../Models/LanguageResourceType.cs | 3 +- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- .../RelationshipsInCreateCountryRequest.cs | 27 ++-- .../RelationshipsInUpdateCountryRequest.cs | 27 ++-- .../Models/ResourceCollectionTopLevelLinks.cs | 61 +++++--- ...sourceIdentifierCollectionTopLevelLinks.cs | 69 +++++---- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/ToManyLanguageInRequest.cs | 27 ++-- .../Models/ToManyLanguageInResponse.cs | 55 ++++--- .../Models/ToManyLanguageInResponse_meta.cs | 18 ++- .../Models/UpdateCountryRequestDocument.cs | 27 ++-- .../AccommodationsRequestBuilder.cs | 77 +++++----- .../Item/AccommodationsItemRequestBuilder.cs | 75 ++++----- .../Excursions/ExcursionsRequestBuilder.cs | 77 +++++----- .../Item/ExcursionsItemRequestBuilder.cs | 75 ++++----- .../Links/GeneratedCode/LinksClient.cs | 23 +-- .../GeneratedCode/Models/Accommodation.cs | 90 ----------- .../AccommodationAttributesInResponse.cs | 21 +-- ...AccommodationCollectionResponseDocument.cs | 69 +++++---- ...modationCollectionResponseDocument_meta.cs | 18 ++- .../Models/AccommodationDataInResponse.cs | 53 ++++--- .../AccommodationDataInResponse_meta.cs | 18 ++- .../Models/AccommodationIdentifier.cs | 30 ++-- ...AccommodationIdentifierResponseDocument.cs | 55 ++++--- ...modationIdentifierResponseDocument_meta.cs | 18 ++- .../AccommodationPrimaryResponseDocument.cs | 69 +++++---- ...commodationPrimaryResponseDocument_meta.cs | 18 ++- .../Models/AccommodationResourceType.cs | 3 +- .../AccommodationSecondaryResponseDocument.cs | 69 +++++---- ...mmodationSecondaryResponseDocument_meta.cs | 18 ++- .../Models/Accommodation_meta.cs | 58 ------- .../GeneratedCode/Models/Accommodations.cs | 90 ----------- .../Models/Accommodations_meta.cs | 58 ------- .../AttributesInCreateAccommodationRequest.cs | 21 +-- .../AttributesInCreateExcursionRequest.cs | 26 ++-- .../AttributesInCreateTransportRequest.cs | 23 +-- .../AttributesInCreateVacationRequest.cs | 23 +-- .../AttributesInUpdateAccommodationRequest.cs | 21 +-- .../AttributesInUpdateExcursionRequest.cs | 26 ++-- .../AttributesInUpdateTransportRequest.cs | 23 +-- .../AttributesInUpdateVacationRequest.cs | 23 +-- .../CreateAccommodationRequestDocument.cs | 27 ++-- .../Models/CreateExcursionRequestDocument.cs | 27 ++-- .../Models/CreateTransportRequestDocument.cs | 27 ++-- .../Models/CreateVacationRequestDocument.cs | 27 ++-- .../DataInCreateAccommodationRequest.cs | 36 +++-- .../Models/DataInCreateExcursionRequest.cs | 36 +++-- .../Models/DataInCreateTransportRequest.cs | 36 +++-- .../Models/DataInCreateVacationRequest.cs | 50 +++--- .../GeneratedCode/Models/DataInResponse.cs | 37 +++-- .../DataInUpdateAccommodationRequest.cs | 44 +++--- .../Models/DataInUpdateExcursionRequest.cs | 44 +++--- .../Models/DataInUpdateTransportRequest.cs | 44 +++--- .../Models/DataInUpdateVacationRequest.cs | 58 ++++--- .../Links/GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../Links/GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../Links/GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- .../Models/ExcursionAttributesInResponse.cs | 26 ++-- .../ExcursionCollectionResponseDocument.cs | 69 +++++---- ...xcursionCollectionResponseDocument_meta.cs | 18 ++- .../Models/ExcursionDataInResponse.cs | 53 ++++--- .../Models/ExcursionDataInResponse_meta.cs | 18 ++- .../Models/ExcursionIdentifier.cs | 30 ++-- ...ionIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../ExcursionPrimaryResponseDocument.cs | 69 +++++---- .../ExcursionPrimaryResponseDocument_meta.cs | 18 ++- .../Models/ExcursionResourceType.cs | 3 +- .../Links/GeneratedCode/Models/Excursions.cs | 90 ----------- .../GeneratedCode/Models/Excursions_meta.cs | 58 ------- .../Models/NullableToOneTransportInRequest.cs | 27 ++-- .../NullableToOneTransportInResponse.cs | 55 ++++--- .../NullableToOneTransportInResponse_meta.cs | 18 ++- ...ableTransportIdentifierResponseDocument.cs | 55 ++++--- ...ransportIdentifierResponseDocument_meta.cs | 18 ++- ...lableTransportSecondaryResponseDocument.cs | 69 +++++---- ...TransportSecondaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- .../RelationshipsInCreateVacationRequest.cs | 55 ++++--- .../RelationshipsInUpdateVacationRequest.cs | 55 ++++--- .../Models/ResourceCollectionTopLevelLinks.cs | 61 +++++--- ...sourceIdentifierCollectionTopLevelLinks.cs | 69 +++++---- .../Models/ResourceIdentifierTopLevelLinks.cs | 37 +++-- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/ToManyExcursionInRequest.cs | 27 ++-- .../Models/ToManyExcursionInResponse.cs | 55 ++++--- .../Models/ToManyExcursionInResponse_meta.cs | 18 ++- .../Models/ToOneAccommodationInRequest.cs | 27 ++-- .../Models/ToOneAccommodationInResponse.cs | 55 ++++--- .../ToOneAccommodationInResponse_meta.cs | 18 ++- .../Links/GeneratedCode/Models/Transport.cs | 90 ----------- .../Models/TransportAttributesInResponse.cs | 23 +-- .../TransportCollectionResponseDocument.cs | 69 +++++---- ...ransportCollectionResponseDocument_meta.cs | 18 ++- .../Models/TransportDataInResponse.cs | 53 ++++--- .../Models/TransportDataInResponse_meta.cs | 18 ++- .../Models/TransportIdentifier.cs | 30 ++-- .../TransportPrimaryResponseDocument.cs | 69 +++++---- .../TransportPrimaryResponseDocument_meta.cs | 18 ++- .../Models/TransportResourceType.cs | 3 +- .../GeneratedCode/Models/Transport_meta.cs | 58 ------- .../Links/GeneratedCode/Models/Transports.cs | 90 ----------- .../GeneratedCode/Models/Transports_meta.cs | 58 ------- .../UpdateAccommodationRequestDocument.cs | 27 ++-- .../Models/UpdateExcursionRequestDocument.cs | 27 ++-- .../Models/UpdateTransportRequestDocument.cs | 27 ++-- .../Models/UpdateVacationRequestDocument.cs | 27 ++-- .../Models/VacationAttributesInResponse.cs | 23 +-- .../VacationCollectionResponseDocument.cs | 69 +++++---- ...VacationCollectionResponseDocument_meta.cs | 18 ++- .../Models/VacationDataInResponse.cs | 67 +++++---- .../Models/VacationDataInResponse_meta.cs | 18 ++- .../Models/VacationPrimaryResponseDocument.cs | 69 +++++---- .../VacationPrimaryResponseDocument_meta.cs | 18 ++- .../Models/VacationRelationshipsInResponse.cs | 55 ++++--- .../Models/VacationResourceType.cs | 3 +- .../Links/GeneratedCode/Models/Vacations.cs | 106 ------------- .../GeneratedCode/Models/Vacations_meta.cs | 58 ------- .../Item/TransportsItemRequestBuilder.cs | 75 ++++----- .../Transports/TransportsRequestBuilder.cs | 77 +++++----- .../AccommodationRequestBuilder.cs | 43 +++--- .../Excursions/ExcursionsRequestBuilder.cs | 43 +++--- .../AccommodationRequestBuilder.cs | 63 ++++---- .../Excursions/ExcursionsRequestBuilder.cs | 103 ++++++------- .../RelationshipsRequestBuilder.cs | 21 +-- .../Transport/TransportRequestBuilder.cs | 63 ++++---- .../Item/Transport/TransportRequestBuilder.cs | 43 +++--- .../Item/VacationsItemRequestBuilder.cs | 91 +++++------ .../Vacations/VacationsRequestBuilder.cs | 77 +++++----- .../ModelStateValidationClient.cs | 11 +- ...ibutesInCreateSocialMediaAccountRequest.cs | 142 +++++++++++------- ...ibutesInUpdateSocialMediaAccountRequest.cs | 142 +++++++++++------- ...CreateSocialMediaAccountRequestDocument.cs | 27 ++-- .../DataInCreateSocialMediaAccountRequest.cs | 36 +++-- .../GeneratedCode/Models/DataInResponse.cs | 31 ++-- .../DataInUpdateSocialMediaAccountRequest.cs | 44 +++--- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../SocialMediaAccountAttributesInResponse.cs | 142 +++++++++++------- .../SocialMediaAccountDataInResponse.cs | 53 ++++--- .../SocialMediaAccountDataInResponse_meta.cs | 18 ++- ...cialMediaAccountPrimaryResponseDocument.cs | 69 +++++---- ...ediaAccountPrimaryResponseDocument_meta.cs | 18 ++- .../Models/SocialMediaAccountResourceType.cs | 3 +- .../Models/SocialMediaAccounts.cs | 90 ----------- .../Models/SocialMediaAccounts_meta.cs | 58 ------- ...UpdateSocialMediaAccountRequestDocument.cs | 27 ++-- .../SocialMediaAccountsItemRequestBuilder.cs | 43 +++--- .../SocialMediaAccountsRequestBuilder.cs | 53 +++---- .../AttributesInCreateNameValuePairRequest.cs | 29 ++-- .../Models/AttributesInCreateNodeRequest.cs | 29 ++-- .../AttributesInUpdateNameValuePairRequest.cs | 29 ++-- .../Models/AttributesInUpdateNodeRequest.cs | 29 ++-- .../CreateNameValuePairRequestDocument.cs | 27 ++-- .../Models/CreateNodeRequestDocument.cs | 27 ++-- .../DataInCreateNameValuePairRequest.cs | 50 +++--- .../Models/DataInCreateNodeRequest.cs | 50 +++--- .../GeneratedCode/Models/DataInResponse.cs | 33 ++-- .../DataInUpdateNameValuePairRequest.cs | 58 ++++--- .../Models/DataInUpdateNodeRequest.cs | 58 ++++--- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- .../NameValuePairAttributesInResponse.cs | 29 ++-- ...NameValuePairCollectionResponseDocument.cs | 69 +++++---- ...aluePairCollectionResponseDocument_meta.cs | 18 ++- .../Models/NameValuePairDataInResponse.cs | 67 +++++---- .../NameValuePairDataInResponse_meta.cs | 18 ++- .../Models/NameValuePairIdentifier.cs | 30 ++-- ...airIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../NameValuePairPrimaryResponseDocument.cs | 69 +++++---- ...meValuePairPrimaryResponseDocument_meta.cs | 18 ++- .../NameValuePairRelationshipsInResponse.cs | 27 ++-- .../Models/NameValuePairResourceType.cs | 3 +- .../GeneratedCode/Models/NameValuePairs.cs | 106 ------------- .../Models/NameValuePairs_meta.cs | 58 ------- .../Models/NodeAttributesInResponse.cs | 29 ++-- .../Models/NodeCollectionResponseDocument.cs | 69 +++++---- .../NodeCollectionResponseDocument_meta.cs | 18 ++- .../Models/NodeDataInResponse.cs | 67 +++++---- .../Models/NodeDataInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/NodeIdentifier.cs | 30 ++-- ...odeIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../Models/NodeIdentifierResponseDocument.cs | 55 ++++--- .../NodeIdentifierResponseDocument_meta.cs | 18 ++- .../Models/NodePrimaryResponseDocument.cs | 69 +++++---- .../NodePrimaryResponseDocument_meta.cs | 18 ++- .../Models/NodeRelationshipsInResponse.cs | 55 ++++--- .../GeneratedCode/Models/NodeResourceType.cs | 3 +- .../Models/NodeSecondaryResponseDocument.cs | 69 +++++---- .../NodeSecondaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/Nodes.cs | 106 ------------- .../GeneratedCode/Models/Nodes_meta.cs | 58 ------- .../NullableNodeIdentifierResponseDocument.cs | 55 ++++--- ...ableNodeIdentifierResponseDocument_meta.cs | 18 ++- .../NullableNodeSecondaryResponseDocument.cs | 69 +++++---- ...lableNodeSecondaryResponseDocument_meta.cs | 18 ++- .../Models/NullableToOneNodeInRequest.cs | 27 ++-- .../Models/NullableToOneNodeInResponse.cs | 55 ++++--- .../NullableToOneNodeInResponse_meta.cs | 18 ++- .../GeneratedCode/Models/Owner.cs | 106 ------------- .../GeneratedCode/Models/Owner_meta.cs | 58 ------- .../GeneratedCode/Models/Parent.cs | 106 ------------- .../GeneratedCode/Models/Parent_meta.cs | 58 ------- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- ...lationshipsInCreateNameValuePairRequest.cs | 27 ++-- .../RelationshipsInCreateNodeRequest.cs | 55 ++++--- ...lationshipsInUpdateNameValuePairRequest.cs | 27 ++-- .../RelationshipsInUpdateNodeRequest.cs | 55 ++++--- .../Models/ResourceCollectionTopLevelLinks.cs | 61 +++++--- ...sourceIdentifierCollectionTopLevelLinks.cs | 69 +++++---- .../Models/ResourceIdentifierTopLevelLinks.cs | 37 +++-- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/ToManyNameValuePairInRequest.cs | 27 ++-- .../Models/ToManyNameValuePairInResponse.cs | 55 ++++--- .../ToManyNameValuePairInResponse_meta.cs | 18 ++- .../Models/ToManyNodeInRequest.cs | 27 ++-- .../Models/ToManyNodeInResponse.cs | 55 ++++--- .../Models/ToManyNodeInResponse_meta.cs | 18 ++- .../Models/ToOneNodeInRequest.cs | 27 ++-- .../Models/ToOneNodeInResponse.cs | 55 ++++--- .../Models/ToOneNodeInResponse_meta.cs | 18 ++- .../UpdateNameValuePairRequestDocument.cs | 27 ++-- .../Models/UpdateNodeRequestDocument.cs | 27 ++-- .../Item/NameValuePairsItemRequestBuilder.cs | 83 +++++----- .../Item/Owner/OwnerRequestBuilder.cs | 43 +++--- .../Owner/OwnerRequestBuilder.cs | 63 ++++---- .../RelationshipsRequestBuilder.cs | 13 +- .../NameValuePairsRequestBuilder.cs | 77 +++++----- .../Item/Children/ChildrenRequestBuilder.cs | 43 +++--- .../Nodes/Item/NodesItemRequestBuilder.cs | 91 +++++------ .../Nodes/Item/Parent/ParentRequestBuilder.cs | 43 +++--- .../Children/ChildrenRequestBuilder.cs | 103 ++++++------- .../Parent/ParentRequestBuilder.cs | 63 ++++---- .../RelationshipsRequestBuilder.cs | 21 +-- .../Values/ValuesRequestBuilder.cs | 103 ++++++------- .../Nodes/Item/Values/ValuesRequestBuilder.cs | 43 +++--- .../Nodes/NodesRequestBuilder.cs | 77 +++++----- .../GeneratedCode/QueryStringsClient.cs | 15 +- .../DataStreams/DataStreamsRequestBuilder.cs | 45 +++--- .../Item/DataStreamsItemRequestBuilder.cs | 43 +++--- ...tributesInCreateWriteOnlyChannelRequest.cs | 31 ++-- ...tributesInUpdateWriteOnlyChannelRequest.cs | 31 ++-- .../CreateWriteOnlyChannelRequestDocument.cs | 27 ++-- .../DataInCreateWriteOnlyChannelRequest.cs | 50 +++--- .../GeneratedCode/Models/DataInResponse.cs | 37 +++-- .../DataInUpdateWriteOnlyChannelRequest.cs | 58 ++++--- .../Models/DataStreamAttributesInResponse.cs | 18 ++- .../DataStreamCollectionResponseDocument.cs | 69 +++++---- ...taStreamCollectionResponseDocument_meta.cs | 18 ++- .../Models/DataStreamDataInResponse.cs | 53 ++++--- .../Models/DataStreamDataInResponse_meta.cs | 18 ++- .../Models/DataStreamIdentifier.cs | 30 ++-- ...eamIdentifierCollectionResponseDocument.cs | 55 ++++--- ...entifierCollectionResponseDocument_meta.cs | 18 ++- .../DataStreamIdentifierResponseDocument.cs | 55 ++++--- ...taStreamIdentifierResponseDocument_meta.cs | 18 ++- .../DataStreamPrimaryResponseDocument.cs | 69 +++++---- .../DataStreamPrimaryResponseDocument_meta.cs | 18 ++- .../Models/DataStreamResourceType.cs | 3 +- .../DataStreamSecondaryResponseDocument.cs | 69 +++++---- ...ataStreamSecondaryResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/DataStreams.cs | 90 ----------- .../GeneratedCode/Models/DataStreams_meta.cs | 58 ------- .../GeneratedCode/Models/ErrorLinks.cs | 29 ++-- .../GeneratedCode/Models/ErrorObject.cs | 95 +++++++----- .../GeneratedCode/Models/ErrorObject_meta.cs | 18 ++- .../Models/ErrorResponseDocument.cs | 55 ++++--- .../Models/ErrorResponseDocument_meta.cs | 18 ++- .../GeneratedCode/Models/ErrorSource.cs | 37 +++-- .../Models/ErrorTopLevelLinks.cs | 29 ++-- ...bleDataStreamIdentifierResponseDocument.cs | 55 ++++--- ...taStreamIdentifierResponseDocument_meta.cs | 18 ++- ...ableDataStreamSecondaryResponseDocument.cs | 69 +++++---- ...ataStreamSecondaryResponseDocument_meta.cs | 18 ++- .../NullableToOneDataStreamInRequest.cs | 27 ++-- .../NullableToOneDataStreamInResponse.cs | 55 ++++--- .../NullableToOneDataStreamInResponse_meta.cs | 18 ++- .../ReadOnlyChannelAttributesInResponse.cs | 31 ++-- ...adOnlyChannelCollectionResponseDocument.cs | 69 +++++---- ...yChannelCollectionResponseDocument_meta.cs | 18 ++- .../Models/ReadOnlyChannelDataInResponse.cs | 67 +++++---- .../ReadOnlyChannelDataInResponse_meta.cs | 18 ++- .../ReadOnlyChannelPrimaryResponseDocument.cs | 69 +++++---- ...OnlyChannelPrimaryResponseDocument_meta.cs | 18 ++- .../ReadOnlyChannelRelationshipsInResponse.cs | 55 ++++--- .../GeneratedCode/Models/ReadOnlyChannels.cs | 106 ------------- .../Models/ReadOnlyChannels_meta.cs | 58 ------- ...OnlyResourceChannelAttributesInResponse.cs | 31 ++-- ...sourceChannelCollectionResponseDocument.cs | 69 +++++---- ...eChannelCollectionResponseDocument_meta.cs | 18 ++- .../ReadOnlyResourceChannelDataInResponse.cs | 67 +++++---- ...dOnlyResourceChannelDataInResponse_meta.cs | 18 ++- ...yResourceChannelPrimaryResponseDocument.cs | 69 +++++---- ...urceChannelPrimaryResponseDocument_meta.cs | 18 ++- ...yResourceChannelRelationshipsInResponse.cs | 55 ++++--- .../Models/ReadOnlyResourceChannels.cs | 106 ------------- .../Models/ReadOnlyResourceChannels_meta.cs | 58 ------- .../GeneratedCode/Models/RelationshipLinks.cs | 29 ++-- ...ionshipsInCreateWriteOnlyChannelRequest.cs | 55 ++++--- ...ionshipsInUpdateWriteOnlyChannelRequest.cs | 55 ++++--- .../Models/ResourceCollectionTopLevelLinks.cs | 61 +++++--- ...sourceIdentifierCollectionTopLevelLinks.cs | 69 +++++---- .../Models/ResourceIdentifierTopLevelLinks.cs | 37 +++-- .../GeneratedCode/Models/ResourceLinks.cs | 21 +-- .../Models/ResourceTopLevelLinks.cs | 29 ++-- .../Models/ToManyDataStreamInRequest.cs | 27 ++-- .../Models/ToManyDataStreamInResponse.cs | 55 ++++--- .../Models/ToManyDataStreamInResponse_meta.cs | 18 ++- .../Models/ToOneDataStreamInRequest.cs | 27 ++-- .../Models/ToOneDataStreamInResponse.cs | 55 ++++--- .../Models/ToOneDataStreamInResponse_meta.cs | 18 ++- .../Models/UltraHighDefinitionVideoStream.cs | 90 ----------- .../UltraHighDefinitionVideoStream_meta.cs | 58 ------- .../UpdateWriteOnlyChannelRequestDocument.cs | 27 ++-- .../GeneratedCode/Models/VideoStream.cs | 90 ----------- .../GeneratedCode/Models/VideoStream_meta.cs | 58 ------- .../WriteOnlyChannelAttributesInResponse.cs | 31 ++-- .../Models/WriteOnlyChannelDataInResponse.cs | 67 +++++---- .../WriteOnlyChannelDataInResponse_meta.cs | 18 ++- ...WriteOnlyChannelPrimaryResponseDocument.cs | 69 +++++---- ...OnlyChannelPrimaryResponseDocument_meta.cs | 18 ++- ...WriteOnlyChannelRelationshipsInResponse.cs | 55 ++++--- .../Models/WriteOnlyChannelResourceType.cs | 3 +- .../GeneratedCode/Models/WriteOnlyChannels.cs | 106 ------------- .../Models/WriteOnlyChannels_meta.cs | 58 ------- .../AudioStreamsRequestBuilder.cs | 43 +++--- .../ReadOnlyChannelsItemRequestBuilder.cs | 59 ++++---- .../AudioStreamsRequestBuilder.cs | 43 +++--- .../RelationshipsRequestBuilder.cs | 21 +-- ...HighDefinitionVideoStreamRequestBuilder.cs | 43 +++--- .../VideoStream/VideoStreamRequestBuilder.cs | 43 +++--- ...HighDefinitionVideoStreamRequestBuilder.cs | 43 +++--- .../VideoStream/VideoStreamRequestBuilder.cs | 43 +++--- .../ReadOnlyChannelsRequestBuilder.cs | 45 +++--- .../AudioStreamsRequestBuilder.cs | 43 +++--- ...dOnlyResourceChannelsItemRequestBuilder.cs | 55 +++---- ...HighDefinitionVideoStreamRequestBuilder.cs | 43 +++--- .../VideoStream/VideoStreamRequestBuilder.cs | 43 +++--- .../ReadOnlyResourceChannelsRequestBuilder.cs | 45 +++--- .../RelationshipChannelsItemRequestBuilder.cs | 13 +- .../AudioStreamsRequestBuilder.cs | 103 ++++++------- .../RelationshipsRequestBuilder.cs | 21 +-- ...HighDefinitionVideoStreamRequestBuilder.cs | 63 ++++---- .../VideoStream/VideoStreamRequestBuilder.cs | 63 ++++---- .../RelationshipChannelsRequestBuilder.cs | 15 +- .../RestrictedControllersClient.cs | 27 ++-- .../AudioStreamsRequestBuilder.cs | 75 ++++----- .../RelationshipsRequestBuilder.cs | 21 +-- ...HighDefinitionVideoStreamRequestBuilder.cs | 35 ++--- .../VideoStream/VideoStreamRequestBuilder.cs | 35 ++--- .../WriteOnlyChannelsItemRequestBuilder.cs | 51 ++++--- .../WriteOnlyChannelsRequestBuilder.cs | 53 +++---- 602 files changed, 12186 insertions(+), 13848 deletions(-) delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels_meta.cs diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 35524d4221..f23a723cef 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -6,31 +6,36 @@ "version": "2024.1.4", "commands": [ "jb" - ] + ], + "rollForward": false }, "regitlint": { "version": "6.3.12", "commands": [ "regitlint" - ] + ], + "rollForward": false }, "dotnet-reportgenerator-globaltool": { "version": "5.3.6", "commands": [ "reportgenerator" - ] + ], + "rollForward": false }, "docfx": { "version": "2.76.0", "commands": [ "docfx" - ] + ], + "rollForward": false }, "microsoft.openapi.kiota": { - "version": "1.14.0", + "version": "1.15.0", "commands": [ "kiota" - ] + ], + "rollForward": false } } } \ No newline at end of file diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs index 4bd6ebd6b3..6b76adb2b8 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api { +namespace OpenApiKiotaClientExample.GeneratedCode.Api +{ /// /// Builds and executes requests for operations under \api /// - public class ApiRequestBuilder : BaseRequestBuilder + public class ApiRequestBuilder : BaseRequestBuilder { /// The people property - public PeopleRequestBuilder People + public OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder People { - get => new PeopleRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder(PathParameters, RequestAdapter); } /// The tags property - public TagsRequestBuilder Tags + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder Tags { - get => new TagsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); } /// The todoItems property - public TodoItemsRequestBuilder TodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder TodoItems { - get => new TodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public ApiRequestBuilder(Dictionary pathParameters, IRequestAdap { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs index 52081b8d19..c227373f50 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems +{ /// /// Builds and executes requests for operations under \api\people\{id}\assignedTodoItems /// - public class AssignedTodoItemsRequestBuilder : BaseRequestBuilder + public class AssignedTodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AssignedTodoItemsRequestBuilder(Dictionary pathParameters { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAda /// /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AssignedTodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems.AssignedTodoItemsRequestBuilder WithUrl(string rawUrl) { - return new AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems.AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs index 8215a1831d..6bd42bf7c1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems +{ /// /// Builds and executes requests for operations under \api\people\{id}\ownedTodoItems /// - public class OwnedTodoItemsRequestBuilder : BaseRequestBuilder + public class OwnedTodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnedTodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder WithUrl(string rawUrl) { - return new OwnedTodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs index b485a3249d..250d9c9056 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/PeopleItemRequestBuilder.cs @@ -11,29 +11,30 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item +{ /// /// Builds and executes requests for operations under \api\people\{id} /// - public class PeopleItemRequestBuilder : BaseRequestBuilder + public class PeopleItemRequestBuilder : BaseRequestBuilder { /// The assignedTodoItems property - public AssignedTodoItemsRequestBuilder AssignedTodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems.AssignedTodoItemsRequestBuilder AssignedTodoItems { - get => new AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.AssignedTodoItems.AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// The ownedTodoItems property - public OwnedTodoItemsRequestBuilder OwnedTodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder OwnedTodoItems { - get => new OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.OwnedTodoItems.OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -41,7 +42,7 @@ public PeopleItemRequestBuilder(Dictionary pathParameters, IRequ { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -53,7 +54,7 @@ public PeopleItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -66,34 +67,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual person by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -102,11 +103,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -115,33 +116,33 @@ public async Task HeadAsync(Action /// Updates an existing person. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing person by its identifier. @@ -169,11 +170,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -188,11 +189,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -207,11 +208,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdatePersonRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdatePersonRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -224,11 +225,11 @@ public RequestInformation ToPatchRequestInformation(UpdatePersonRequestDocument /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public PeopleItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder WithUrl(string rawUrl) { - return new PeopleItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual person by its identifier. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs index b45212a50f..ce90b973b9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/AssignedTodoItems/AssignedTodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems +{ /// /// Builds and executes requests for operations under \api\people\{id}\relationships\assignedTodoItems /// - public class AssignedTodoItemsRequestBuilder : BaseRequestBuilder + public class AssignedTodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AssignedTodoItemsRequestBuilder(Dictionary pathParameters { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public AssignedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAda /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyTodoItemInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyTodoItemInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest bod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AssignedTodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder WithUrl(string rawUrl) { - return new AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs index 1379b9098e..5476a77592 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/OwnedTodoItems/OwnedTodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems +{ /// /// Builds and executes requests for operations under \api\people\{id}\relationships\ownedTodoItems /// - public class OwnedTodoItemsRequestBuilder : BaseRequestBuilder + public class OwnedTodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnedTodoItemsRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public OwnedTodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyTodoItemInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyTodoItemInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest bod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnedTodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder WithUrl(string rawUrl) { - return new OwnedTodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs index 7788191044..b3d60c6035 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/Item/Relationships/RelationshipsRequestBuilder.cs @@ -7,24 +7,25 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships +{ /// /// Builds and executes requests for operations under \api\people\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The assignedTodoItems property - public AssignedTodoItemsRequestBuilder AssignedTodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder AssignedTodoItems { - get => new AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.AssignedTodoItems.AssignedTodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// The ownedTodoItems property - public OwnedTodoItemsRequestBuilder OwnedTodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder OwnedTodoItems { - get => new OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.Relationships.OwnedTodoItems.OwnedTodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -32,7 +33,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs index 03e061ad10..19152cc579 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/People/PeopleRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.People { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.People +{ /// /// Builds and executes requests for operations under \api\people /// - public class PeopleRequestBuilder : BaseRequestBuilder + public class PeopleRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaClientExample.GeneratedCode.api.people.item collection /// The identifier of the person to retrieve. - /// A - public PeopleItemRequestBuilder this[string position] + /// A + public OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new PeopleItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.Item.PeopleItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public PeopleRequestBuilder(Dictionary pathParameters, IRequestA { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public PeopleRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// /// Retrieves a collection of people. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new person. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of people. @@ -123,11 +124,11 @@ public async Task PostAsync(CreatePersonRequestDo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreatePersonRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreatePersonRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreatePersonRequestDocument b /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public PeopleRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder WithUrl(string rawUrl) { - return new PeopleRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of people. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs index cfdca79b86..3a0e06dd82 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/RelationshipsRequestBuilder.cs @@ -6,19 +6,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships +{ /// /// Builds and executes requests for operations under \api\tags\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The todoItems property - public TodoItemsRequestBuilder TodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder TodoItems { - get => new TodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -26,7 +27,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs index 1c2af4e889..af9159ef08 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/Relationships/TodoItems/TodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems +{ /// /// Builds and executes requests for operations under \api\tags\{id}\relationships\todoItems /// - public class TodoItemsRequestBuilder : BaseRequestBuilder + public class TodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TodoItemsRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related todoItem identities of an individual tag's todoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyTodoItemInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyTodoItemInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyTodoItemInRequest bod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyTodoItemInRequest body /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyTodoItemInRequest body, /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder WithUrl(string rawUrl) { - return new TodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.TodoItems.TodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItem identities of an individual tag's todoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs index 8e61929887..d59d25e799 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TagsItemRequestBuilder.cs @@ -10,24 +10,25 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item +{ /// /// Builds and executes requests for operations under \api\tags\{id} /// - public class TagsItemRequestBuilder : BaseRequestBuilder + public class TagsItemRequestBuilder : BaseRequestBuilder { /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// The todoItems property - public TodoItemsRequestBuilder TodoItems + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder TodoItems { - get => new TodoItemsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public TagsItemRequestBuilder(Dictionary pathParameters, IReques { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public TagsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -60,34 +61,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual tag by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -96,11 +97,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -109,33 +110,33 @@ public async Task HeadAsync(Action /// Updates an existing tag. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing tag by its identifier. @@ -163,11 +164,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -182,11 +183,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -201,11 +202,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateTagRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateTagRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -218,11 +219,11 @@ public RequestInformation ToPatchRequestInformation(UpdateTagRequestDocument bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TagsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder WithUrl(string rawUrl) { - return new TagsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual tag by its identifier. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs index f2a4641981..e1027112a5 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/Item/TodoItems/TodoItemsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems +{ /// /// Builds and executes requests for operations under \api\tags\{id}\todoItems /// - public class TodoItemsRequestBuilder : BaseRequestBuilder + public class TodoItemsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TodoItemsRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves the related todoItems of an individual tag's todoItems relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder WithUrl(string rawUrl) { - return new TodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TodoItems.TodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related todoItems of an individual tag's todoItems relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs index fb76bf8715..d3a85f49f5 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Tags/TagsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Tags +{ /// /// Builds and executes requests for operations under \api\tags /// - public class TagsRequestBuilder : BaseRequestBuilder + public class TagsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaClientExample.GeneratedCode.api.tags.item collection /// The identifier of the tag to retrieve. - /// A - public TagsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new TagsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.Item.TagsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public TagsRequestBuilder(Dictionary pathParameters, IRequestAda { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base( /// /// Retrieves a collection of tags. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new tag. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of tags. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateTagRequestDocument /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateTagRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateTagRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateTagRequestDocument body /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TagsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder WithUrl(string rawUrl) { - return new TagsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of tags. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs index bb29c7bdc6..cff77c921d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Assignee/AssigneeRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\assignee /// - public class AssigneeRequestBuilder : BaseRequestBuilder + public class AssigneeRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AssigneeRequestBuilder(Dictionary pathParameters, IReques { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AssigneeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b /// /// Retrieves the related person of an individual todoItem's assignee relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullablePersonSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AssigneeRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee.AssigneeRequestBuilder WithUrl(string rawUrl) { - return new AssigneeRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee.AssigneeRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related person of an individual todoItem's assignee relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs index 8e5188ce35..bbf87627d2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Owner/OwnerRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\owner /// - public class OwnerRequestBuilder : BaseRequestBuilder + public class OwnerRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnerRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Retrieves the related person of an individual todoItem's owner relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnerRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner.OwnerRequestBuilder WithUrl(string rawUrl) { - return new OwnerRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner.OwnerRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related person of an individual todoItem's owner relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Assignee/AssigneeRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Assignee/AssigneeRequestBuilder.cs index 4dc079bda1..274872cd3d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Assignee/AssigneeRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Assignee/AssigneeRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\relationships\assignee /// - public class AssigneeRequestBuilder : BaseRequestBuilder + public class AssigneeRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AssigneeRequestBuilder(Dictionary pathParameters, IReques { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AssigneeRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b /// /// Retrieves the related person identity of an individual todoItem's assignee relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullablePersonIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NullableToOnePersonInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NullableToOnePersonInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(NullableToOnePersonInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NullableToOnePersonInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NullableToOnePersonInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(NullableToOnePersonInRequest /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AssigneeRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee.AssigneeRequestBuilder WithUrl(string rawUrl) { - return new AssigneeRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee.AssigneeRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related person identity of an individual todoItem's assignee relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Owner/OwnerRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Owner/OwnerRequestBuilder.cs index 9d8f1250cf..8b9a604d1c 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Owner/OwnerRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Owner/OwnerRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\relationships\owner /// - public class OwnerRequestBuilder : BaseRequestBuilder + public class OwnerRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnerRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Retrieves the related person identity of an individual todoItem's owner relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PersonIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToOnePersonInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToOnePersonInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(ToOnePersonInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToOnePersonInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToOnePersonInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(ToOnePersonInRequest body, A /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnerRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner.OwnerRequestBuilder WithUrl(string rawUrl) { - return new OwnerRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner.OwnerRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related person identity of an individual todoItem's owner relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/RelationshipsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/RelationshipsRequestBuilder.cs index 991f23b773..0fb593519a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The assignee property - public AssigneeRequestBuilder Assignee + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee.AssigneeRequestBuilder Assignee { - get => new AssigneeRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Assignee.AssigneeRequestBuilder(PathParameters, RequestAdapter); } /// The owner property - public OwnerRequestBuilder Owner + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner.OwnerRequestBuilder Owner { - get => new OwnerRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Owner.OwnerRequestBuilder(PathParameters, RequestAdapter); } /// The tags property - public TagsRequestBuilder Tags + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags.TagsRequestBuilder Tags { - get => new TagsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Tags/TagsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Tags/TagsRequestBuilder.cs index 2d7e72f150..c9db246a2d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Tags/TagsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Relationships/Tags/TagsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\relationships\tags /// - public class TagsRequestBuilder : BaseRequestBuilder + public class TagsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TagsRequestBuilder(Dictionary pathParameters, IRequestAda { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base( /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related tag identities of an individual todoItem's tags relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyTagInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyTagInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyTagInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyTagInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyTagInRequest body, Ac /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyTagInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyTagInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyTagInRequest body, Act /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyTagInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyTagInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyTagInRequest body, Acti /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TagsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags.TagsRequestBuilder WithUrl(string rawUrl) { - return new TagsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related tag identities of an individual todoItem's tags relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Tags/TagsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Tags/TagsRequestBuilder.cs index 587268c976..fe9a5f363e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Tags/TagsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/Tags/TagsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags +{ /// /// Builds and executes requests for operations under \api\todoItems\{id}\tags /// - public class TagsRequestBuilder : BaseRequestBuilder + public class TagsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TagsRequestBuilder(Dictionary pathParameters, IRequestAda { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public TagsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base( /// /// Retrieves the related tags of an individual todoItem's tags relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TagCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TagsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags.TagsRequestBuilder WithUrl(string rawUrl) { - return new TagsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags.TagsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related tags of an individual todoItem's tags relationship. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs index 516026cdd2..b139227026 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/Item/TodoItemsItemRequestBuilder.cs @@ -12,34 +12,35 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item +{ /// /// Builds and executes requests for operations under \api\todoItems\{id} /// - public class TodoItemsItemRequestBuilder : BaseRequestBuilder + public class TodoItemsItemRequestBuilder : BaseRequestBuilder { /// The assignee property - public AssigneeRequestBuilder Assignee + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee.AssigneeRequestBuilder Assignee { - get => new AssigneeRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Assignee.AssigneeRequestBuilder(PathParameters, RequestAdapter); } /// The owner property - public OwnerRequestBuilder Owner + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner.OwnerRequestBuilder Owner { - get => new OwnerRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Owner.OwnerRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// The tags property - public TagsRequestBuilder Tags + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags.TagsRequestBuilder Tags { - get => new TagsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.Tags.TagsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public TodoItemsItemRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -59,7 +60,7 @@ public TodoItemsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -72,34 +73,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual todoItem by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -108,11 +109,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -121,33 +122,33 @@ public async Task HeadAsync(Action /// Updates an existing todoItem. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing todoItem by its identifier. @@ -175,11 +176,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -194,11 +195,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -213,11 +214,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateTodoItemRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -230,11 +231,11 @@ public RequestInformation ToPatchRequestInformation(UpdateTodoItemRequestDocumen /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TodoItemsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.TodoItemsItemRequestBuilder WithUrl(string rawUrl) { - return new TodoItemsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.TodoItemsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual todoItem by its identifier. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs index 1bfd200d9a..e3c17c3e0f 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/TodoItems/TodoItemsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems { +namespace OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems +{ /// /// Builds and executes requests for operations under \api\todoItems /// - public class TodoItemsRequestBuilder : BaseRequestBuilder + public class TodoItemsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaClientExample.GeneratedCode.api.todoItems.item collection /// The identifier of the todoItem to retrieve. - /// A - public TodoItemsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.TodoItemsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new TodoItemsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.Item.TodoItemsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public TodoItemsRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public TodoItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves a collection of todoItems. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new todoItem. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of todoItems. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateTodoItemReque /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateTodoItemRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateTodoItemRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateTodoItemRequestDocument /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TodoItemsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder WithUrl(string rawUrl) { - return new TodoItemsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems.TodoItemsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of todoItems. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/ExampleApiClient.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/ExampleApiClient.cs index d280963aeb..23b0b7c41e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/ExampleApiClient.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/ExampleApiClient.cs @@ -12,19 +12,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaClientExample.GeneratedCode { +namespace OpenApiKiotaClientExample.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class ExampleApiClient : BaseRequestBuilder + public class ExampleApiClient : BaseRequestBuilder { /// The api property - public ApiRequestBuilder Api + public OpenApiKiotaClientExample.GeneratedCode.Api.ApiRequestBuilder Api { - get => new ApiRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaClientExample.GeneratedCode.Api.ApiRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee.cs deleted file mode 100644 index 8905302dd2..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Assignee : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public PersonAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Assignee_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Assignee_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public PersonRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Assignee CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Assignee(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Assignee_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee_meta.cs deleted file mode 100644 index 6b8a5e3490..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Assignee_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Assignee_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Assignee_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Assignee_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Assignee_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs index 6cdc9d6683..5848206b67 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreatePersonRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreatePersonRequest : IBackedModel, IParsable + public class AttributesInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInCreatePersonRequest : IBackedModel, IParsable /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -29,19 +32,21 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreatePersonRequest() { @@ -50,12 +55,12 @@ public AttributesInCreatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs index 4c6d3a79f4..16d707ad26 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTagRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateTagRequest : IBackedModel, IParsable + public class AttributesInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class AttributesInCreateTagRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateTagRequest() { @@ -36,12 +39,12 @@ public AttributesInCreateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs index f9e2c63b05..de94037db2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInCreateTodoItemRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateTodoItemRequest : IBackedModel, IParsable + public class AttributesInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,29 +16,33 @@ public class AttributesInCreateTodoItemRequest : IBackedModel, IParsable /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The durationInHours property - public long? DurationInHours { + public long? DurationInHours + { get { return BackingStore?.Get("durationInHours"); } set { BackingStore?.Set("durationInHours", value); } } /// The priority property - public TodoItemPriority? Priority { - get { return BackingStore?.Get("priority"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPriority? Priority + { + get { return BackingStore?.Get("priority"); } set { BackingStore?.Set("priority", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateTodoItemRequest() { @@ -46,12 +51,12 @@ public AttributesInCreateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"description", n => { Description = n.GetStringValue(); } }, - {"durationInHours", n => { DurationInHours = n.GetLongValue(); } }, - {"priority", n => { Priority = n.GetEnumValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "durationInHours", n => { DurationInHours = n.GetLongValue(); } }, + { "priority", n => { Priority = n.GetEnumValue(); } }, }; } /// @@ -75,7 +80,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("description", Description); writer.WriteLongValue("durationInHours", DurationInHours); - writer.WriteEnumValue("priority", Priority); + writer.WriteEnumValue("priority", Priority); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs index ea3b5f10e3..eb05101e1d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdatePersonRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdatePersonRequest : IBackedModel, IParsable + public class AttributesInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInUpdatePersonRequest : IBackedModel, IParsable /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -29,19 +32,21 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdatePersonRequest() { @@ -50,12 +55,12 @@ public AttributesInUpdatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs index 63b1205863..9005f5eb0d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTagRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateTagRequest : IBackedModel, IParsable + public class AttributesInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class AttributesInUpdateTagRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateTagRequest() { @@ -36,12 +39,12 @@ public AttributesInUpdateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs index 7f1eaf8d15..aafbc36661 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AttributesInUpdateTodoItemRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateTodoItemRequest : IBackedModel, IParsable + public class AttributesInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,29 +16,33 @@ public class AttributesInUpdateTodoItemRequest : IBackedModel, IParsable /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The durationInHours property - public long? DurationInHours { + public long? DurationInHours + { get { return BackingStore?.Get("durationInHours"); } set { BackingStore?.Set("durationInHours", value); } } /// The priority property - public TodoItemPriority? Priority { - get { return BackingStore?.Get("priority"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPriority? Priority + { + get { return BackingStore?.Get("priority"); } set { BackingStore?.Set("priority", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateTodoItemRequest() { @@ -46,12 +51,12 @@ public AttributesInUpdateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"description", n => { Description = n.GetStringValue(); } }, - {"durationInHours", n => { DurationInHours = n.GetLongValue(); } }, - {"priority", n => { Priority = n.GetEnumValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "durationInHours", n => { DurationInHours = n.GetLongValue(); } }, + { "priority", n => { Priority = n.GetEnumValue(); } }, }; } /// @@ -75,7 +80,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("description", Description); writer.WriteLongValue("durationInHours", DurationInHours); - writer.WriteEnumValue("priority", Priority); + writer.WriteEnumValue("priority", Priority); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs index 975aafc687..5cdfe7be63 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreatePersonRequestDocument : IBackedModel, IParsable + public class CreatePersonRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreatePersonRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreatePersonRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreatePersonRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreatePersonRequestDocument() { @@ -36,12 +39,12 @@ public CreatePersonRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreatePersonRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs index 7bd33dceb3..be45af69dd 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateTagRequestDocument : IBackedModel, IParsable + public class CreateTagRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateTagRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateTagRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateTagRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateTagRequestDocument() { @@ -36,12 +39,12 @@ public CreateTagRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateTagRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateTagRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs index 4244ed11c1..9b31049546 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateTodoItemRequestDocument : IBackedModel, IParsable + public class CreateTodoItemRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateTodoItemRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateTodoItemRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateTodoItemRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateTodoItemRequestDocument() { @@ -36,12 +39,12 @@ public CreateTodoItemRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateTodoItemRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs index 0a3897aff4..9f522340dd 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreatePersonRequest : IBackedModel, IParsable + public class DataInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreatePersonRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreatePersonRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreatePersonRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreatePersonRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreatePersonRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public PersonResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreatePersonRequest() { @@ -55,12 +61,12 @@ public DataInCreatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePersonRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePersonRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs index 8231f3c6c9..9c1e3f0045 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateTagRequest : IBackedModel, IParsable + public class DataInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateTagRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateTagRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateTagRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateTagRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateTagRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public TagResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateTagRequest() { @@ -55,12 +61,12 @@ public DataInCreateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTagRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateTagRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs index b4899591ba..b75f6cb9e9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateTodoItemRequest : IBackedModel, IParsable + public class DataInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateTodoItemRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateTodoItemRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateTodoItemRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateTodoItemRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateTodoItemRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public TodoItemResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateTodoItemRequest() { @@ -55,12 +61,12 @@ public DataInCreateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs index a3d6e7bc9c..02587685bb 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,18 +55,18 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "people" => new PersonDataInResponse(), - "tags" => new TagDataInResponse(), - "todoItems" => new TodoItemDataInResponse(), - _ => new DataInResponse(), + "people" => new OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse(), + "tags" => new OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse(), + "todoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse(), + _ => new OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse(), }; } /// @@ -72,8 +77,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs index 3a368b46b9..fed9d0b96c 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdatePersonRequest : IBackedModel, IParsable + public class DataInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdatePersonRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdatePersonRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdatePersonRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdatePersonRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdatePersonRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public PersonResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdatePersonRequest() { @@ -69,12 +77,12 @@ public DataInUpdatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs index 6aa61a09b8..d57b44ab5f 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateTagRequest : IBackedModel, IParsable + public class DataInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateTagRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateTagRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateTagRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateTagRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateTagRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public TagResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateTagRequest() { @@ -69,12 +77,12 @@ public DataInUpdateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTagRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateTagRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs index ec76541613..c23ed28b97 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateTodoItemRequest : IBackedModel, IParsable + public class DataInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateTodoItemRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateTodoItemRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateTodoItemRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateTodoItemRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateTodoItemRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public TodoItemResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateTodoItemRequest() { @@ -69,12 +77,12 @@ public DataInUpdateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorLinks.cs index b96efc5eb7..4a622105fd 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs index 16ac4cae05..11a3f0aa02 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs index 327d724d74..b13fe58bdb 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs index d26d683293..578fa28136 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs index 19a1395af7..bc12b9eb0c 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorSource.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorSource.cs index 3c9851e34d..5dd7d7789d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorSource.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorTopLevelLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorTopLevelLinks.cs index ad81c20785..7583daf68a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs index 18d3e101ef..3aed69aae1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullablePersonIdentifierResponseDocument : IBackedModel, IParsable + public class NullablePersonIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullablePersonIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullablePersonIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullablePersonIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullablePersonIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public NullablePersonIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullablePersonIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullablePersonIdentifierResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullablePersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs index ae8d19cc6a..2160b0f615 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullablePersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullablePersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullablePersonIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullablePersonIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullablePersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullablePersonIdentifierResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs index 1ce76cd54e..489f707bb1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullablePersonSecondaryResponseDocument : IBackedModel, IParsable + public class NullablePersonSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NullablePersonSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Assignee? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Assignee Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullablePersonSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullablePersonSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullablePersonSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public NullablePersonSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullablePersonSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullablePersonSecondaryResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Assignee.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullablePersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs index 251bb40845..3e3404dbff 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullablePersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullablePersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullablePersonSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullablePersonSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullablePersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullablePersonSecondaryResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs index a08548d369..64afce05b9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOnePersonInRequest : IBackedModel, IParsable + public class NullableToOnePersonInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class NullableToOnePersonInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOnePersonInRequest() { @@ -36,12 +39,12 @@ public NullableToOnePersonInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOnePersonInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOnePersonInRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs index 2601b838ee..13c01c0b44 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOnePersonInResponse : IBackedModel, IParsable + public class NullableToOnePersonInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableToOnePersonInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOnePersonInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableToOnePersonInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOnePersonInResponse() { @@ -64,12 +71,12 @@ public NullableToOnePersonInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOnePersonInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOnePersonInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs index d12b8ddc32..b1891bff97 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOnePersonInResponse_meta() { @@ -28,12 +30,12 @@ public NullableToOnePersonInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOnePersonInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner.cs deleted file mode 100644 index 6210c71d31..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Owner : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public PersonAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Owner_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Owner_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public PersonRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Owner CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Owner(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Owner_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner_meta.cs deleted file mode 100644 index 078a16b784..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Owner_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Owner_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Owner_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Owner_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Owner_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People.cs deleted file mode 100644 index 80714e0e55..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class People : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public PersonAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public People_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public People_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PersonRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public PersonRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new People CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new People(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(People_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People_meta.cs deleted file mode 100644 index 8c6226e4f6..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/People_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class People_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public People_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static People_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new People_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInResponse.cs index 1169d954fc..be5f5d3845 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonAttributesInResponse : IBackedModel, IParsable + public class PersonAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class PersonAttributesInResponse : IBackedModel, IParsable /// The displayName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? DisplayName { + public string? DisplayName + { get { return BackingStore?.Get("displayName"); } set { BackingStore?.Set("displayName", value); } } #nullable restore #else - public string DisplayName { + public string DisplayName + { get { return BackingStore?.Get("displayName"); } set { BackingStore?.Set("displayName", value); } } @@ -29,13 +32,15 @@ public string DisplayName { /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -43,19 +48,21 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonAttributesInResponse() { @@ -64,12 +71,12 @@ public PersonAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonAttributesInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"displayName", n => { DisplayName = n.GetStringValue(); } }, - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, + { "displayName", n => { DisplayName = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs index ae4f5427da..2bacfc6923 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonCollectionResponseDocument : IBackedModel, IParsable + public class PersonCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class PersonCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PersonCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonCollectionResponseDocument() { @@ -78,12 +87,12 @@ public PersonCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonCollectionResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(PersonDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PersonCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs index e65fd45fc9..ef283cc797 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PersonCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public PersonCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonCollectionResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs index bec2eb7ed0..05dbd78c35 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonDataInResponse : DataInResponse, IParsable + public class PersonDataInResponse : OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PersonAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PersonDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PersonRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new PersonDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonDataInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PersonDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs index db222a24bd..931730a1c4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PersonDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonDataInResponse_meta() { @@ -28,12 +30,12 @@ public PersonDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonDataInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs index 4710cf2c60..5f537d94cf 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonIdentifier : IBackedModel, IParsable + public class PersonIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class PersonIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public PersonResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonIdentifier() { @@ -41,12 +45,12 @@ public PersonIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs index 8c9ce083ef..3a27d84d0a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonIdentifierResponseDocument : IBackedModel, IParsable + public class PersonIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class PersonIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PersonIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public PersonIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonIdentifierResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs index db4e6d8df6..ed64925499 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public PersonIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonIdentifierResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs index d7b292b08c..4768336cdb 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonPrimaryResponseDocument : IBackedModel, IParsable + public class PersonPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class PersonPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public People? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public People Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PersonPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public PersonPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonPrimaryResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(People.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PersonPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs index 158f49b8c5..cf3d4cbd23 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PersonPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public PersonPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonPrimaryResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInResponse.cs index cd113a8e3b..3edc5c31a6 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonRelationshipsInResponse : IBackedModel, IParsable + public class PersonRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInResponse? AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse? AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInResponse AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #endif @@ -29,19 +32,21 @@ public ToManyTodoItemInResponse AssignedTodoItems { /// The ownedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInResponse? OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse? OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInResponse OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonRelationshipsInResponse() { @@ -50,12 +55,12 @@ public PersonRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonRelationshipsInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, - {"ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, + { "assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, + { "ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -76,8 +81,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); - writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); + writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); + writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonResourceType.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonResourceType.cs index 36c263f835..7125751173 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonResourceType.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum PersonResourceType #pragma warning restore CS1591 diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs index 5c1d69cda8..38eaa557c2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonSecondaryResponseDocument : IBackedModel, IParsable + public class PersonSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class PersonSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Owner? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Owner Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PersonSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public PersonSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonSecondaryResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Owner.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs index cbfbb5ca00..9190eb2484 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PersonSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public PersonSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PersonSecondaryResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipLinks.cs index 0ba3824dad..d38cf66ffe 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs index ddaff97212..84e134b899 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreatePersonRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreatePersonRequest : IBackedModel, IParsable + public class RelationshipsInCreatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #endif @@ -29,19 +32,21 @@ public ToManyTodoItemInRequest AssignedTodoItems { /// The ownedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreatePersonRequest() { @@ -50,12 +55,12 @@ public RelationshipsInCreatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, - {"ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -76,8 +81,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); - writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); + writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); + writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs index 71445d3c86..768d91a6fe 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTagRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateTagRequest : IBackedModel, IParsable + public class RelationshipsInCreateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInCreateTagRequest : IBackedModel, IParsable /// The todoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateTagRequest() { @@ -36,12 +39,12 @@ public RelationshipsInCreateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"todoItems", n => { TodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "todoItems", n => { TodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("todoItems", TodoItems); + writer.WriteObjectValue("todoItems", TodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs index c5ea5aa713..17fca3b43d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInCreateTodoItemRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateTodoItemRequest : IBackedModel, IParsable + public class RelationshipsInCreateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignee property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOnePersonInRequest? Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest? Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #nullable restore #else - public NullableToOnePersonInRequest Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #endif @@ -29,33 +32,37 @@ public NullableToOnePersonInRequest Assignee { /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOnePersonInRequest? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOnePersonInRequest Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTagInRequest? Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest? Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public ToManyTagInRequest Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateTodoItemRequest() { @@ -64,12 +71,12 @@ public RelationshipsInCreateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignee", n => { Assignee = n.GetObjectValue(NullableToOnePersonInRequest.CreateFromDiscriminatorValue); } }, - {"owner", n => { Owner = n.GetObjectValue(ToOnePersonInRequest.CreateFromDiscriminatorValue); } }, - {"tags", n => { Tags = n.GetObjectValue(ToManyTagInRequest.CreateFromDiscriminatorValue); } }, + { "assignee", n => { Assignee = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest.CreateFromDiscriminatorValue); } }, + { "tags", n => { Tags = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignee", Assignee); - writer.WriteObjectValue("owner", Owner); - writer.WriteObjectValue("tags", Tags); + writer.WriteObjectValue("assignee", Assignee); + writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("tags", Tags); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs index b58750b5b5..9d2913db9f 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdatePersonRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdatePersonRequest : IBackedModel, IParsable + public class RelationshipsInUpdatePersonRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest AssignedTodoItems { - get { return BackingStore?.Get("assignedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest AssignedTodoItems + { + get { return BackingStore?.Get("assignedTodoItems"); } set { BackingStore?.Set("assignedTodoItems", value); } } #endif @@ -29,19 +32,21 @@ public ToManyTodoItemInRequest AssignedTodoItems { /// The ownedTodoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest OwnedTodoItems { - get { return BackingStore?.Get("ownedTodoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest OwnedTodoItems + { + get { return BackingStore?.Get("ownedTodoItems"); } set { BackingStore?.Set("ownedTodoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdatePersonRequest() { @@ -50,12 +55,12 @@ public RelationshipsInUpdatePersonRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdatePersonRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, - {"ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "assignedTodoItems", n => { AssignedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "ownedTodoItems", n => { OwnedTodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -76,8 +81,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); - writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); + writer.WriteObjectValue("assignedTodoItems", AssignedTodoItems); + writer.WriteObjectValue("ownedTodoItems", OwnedTodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs index 2376bdabf3..2515caa3de 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTagRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateTagRequest : IBackedModel, IParsable + public class RelationshipsInUpdateTagRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInUpdateTagRequest : IBackedModel, IParsable /// The todoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInRequest? TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest? TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #nullable restore #else - public ToManyTodoItemInRequest TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateTagRequest() { @@ -36,12 +39,12 @@ public RelationshipsInUpdateTagRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateTagRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"todoItems", n => { TodoItems = n.GetObjectValue(ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, + { "todoItems", n => { TodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("todoItems", TodoItems); + writer.WriteObjectValue("todoItems", TodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs index 0596dbd58f..3dcdd95e58 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RelationshipsInUpdateTodoItemRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateTodoItemRequest : IBackedModel, IParsable + public class RelationshipsInUpdateTodoItemRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignee property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOnePersonInRequest? Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest? Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #nullable restore #else - public NullableToOnePersonInRequest Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #endif @@ -29,33 +32,37 @@ public NullableToOnePersonInRequest Assignee { /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOnePersonInRequest? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOnePersonInRequest Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTagInRequest? Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest? Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public ToManyTagInRequest Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateTodoItemRequest() { @@ -64,12 +71,12 @@ public RelationshipsInUpdateTodoItemRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateTodoItemRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignee", n => { Assignee = n.GetObjectValue(NullableToOnePersonInRequest.CreateFromDiscriminatorValue); } }, - {"owner", n => { Owner = n.GetObjectValue(ToOnePersonInRequest.CreateFromDiscriminatorValue); } }, - {"tags", n => { Tags = n.GetObjectValue(ToManyTagInRequest.CreateFromDiscriminatorValue); } }, + { "assignee", n => { Assignee = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInRequest.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest.CreateFromDiscriminatorValue); } }, + { "tags", n => { Tags = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignee", Assignee); - writer.WriteObjectValue("owner", Owner); - writer.WriteObjectValue("tags", Tags); + writer.WriteObjectValue("assignee", Assignee); + writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("tags", Tags); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs index 28411d1c60..1fd21eb86e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,19 +96,21 @@ public string Prev { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceCollectionTopLevelLinks() { @@ -106,12 +119,12 @@ public ResourceCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceCollectionTopLevelLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -121,12 +134,12 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs index d1092ddd2f..a811aca291 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,13 +96,15 @@ public string Prev { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -99,19 +112,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierCollectionTopLevelLinks() { @@ -120,12 +135,12 @@ public ResourceIdentifierCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierCollectionTopLevelLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -135,13 +150,13 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs index 43f148e83c..77e2209f4a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -43,19 +48,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierTopLevelLinks() { @@ -64,12 +71,12 @@ public ResourceIdentifierTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierTopLevelLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceLinks.cs index c9559c8bd3..7bd54e38b5 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceTopLevelLinks.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceTopLevelLinks.cs index 629b9e2159..72a4cd7404 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInResponse.cs index dfc5c01a97..1dfd3f7476 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagAttributesInResponse : IBackedModel, IParsable + public class TagAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class TagAttributesInResponse : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagAttributesInResponse() { @@ -36,12 +39,12 @@ public TagAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagAttributesInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs index f241875f16..71f90c1e07 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagCollectionResponseDocument : IBackedModel, IParsable + public class TagCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TagCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TagCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagCollectionResponseDocument() { @@ -78,12 +87,12 @@ public TagCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagCollectionResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TagDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TagCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs index b4ff6b0d05..ac61c9b5e9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TagCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public TagCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagCollectionResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs index 5559978c1b..3777ec2c31 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagDataInResponse : DataInResponse, IParsable + public class TagDataInResponse : OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TagAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TagDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TagRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new TagDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagDataInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(TagAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TagDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TagRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs index ab5ff020e0..9540317de9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TagDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagDataInResponse_meta() { @@ -28,12 +30,12 @@ public TagDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagDataInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs index dba8280a1e..c0b41af05d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagIdentifier : IBackedModel, IParsable + public class TagIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class TagIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public TagResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagIdentifier() { @@ -41,12 +45,12 @@ public TagIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs index 11319caad3..a287b6a3e4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class TagIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class TagIdentifierCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TagIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public TagIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagIdentifierCollectionResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TagIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs index 8e283e2c44..c80c65b03a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TagIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public TagIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs index 5153f34559..dda8457413 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagPrimaryResponseDocument : IBackedModel, IParsable + public class TagPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TagPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Tags? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Tags Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TagPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TagPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public TagPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagPrimaryResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Tags.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TagPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs index 852a02d272..fd5d2aa45d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TagPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public TagPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagPrimaryResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInResponse.cs index 22dd74a211..1b027d5df0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TagRelationshipsInResponse : IBackedModel, IParsable + public class TagRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class TagRelationshipsInResponse : IBackedModel, IParsable /// The todoItems property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInResponse? TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse? TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #nullable restore #else - public ToManyTodoItemInResponse TodoItems { - get { return BackingStore?.Get("todoItems"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse TodoItems + { + get { return BackingStore?.Get("todoItems"); } set { BackingStore?.Set("todoItems", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TagRelationshipsInResponse() { @@ -36,12 +39,12 @@ public TagRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TagRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TagRelationshipsInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"todoItems", n => { TodoItems = n.GetObjectValue(ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, + { "todoItems", n => { TodoItems = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("todoItems", TodoItems); + writer.WriteObjectValue("todoItems", TodoItems); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagResourceType.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagResourceType.cs index e700c68b89..9033dd8300 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagResourceType.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum TagResourceType #pragma warning restore CS1591 diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags.cs deleted file mode 100644 index 94f8d112f0..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Tags : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TagAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public TagAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Tags_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Tags_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TagRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public TagRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Tags CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Tags(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(TagAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Tags_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TagRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags_meta.cs deleted file mode 100644 index 72956f285d..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Tags_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Tags_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Tags_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Tags_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Tags_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs index 0385b17e66..a39f34b267 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTagInRequest : IBackedModel, IParsable + public class ToManyTagInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyTagInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTagInRequest() { @@ -36,12 +39,12 @@ public ToManyTagInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTagInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTagInRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs index 61f3637955..f00715e8f1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTagInResponse : IBackedModel, IParsable + public class ToManyTagInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyTagInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTagInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyTagInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTagInResponse() { @@ -64,12 +71,12 @@ public ToManyTagInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTagInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTagInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyTagInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs index f7ef04a811..60e036f613 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTagInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyTagInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTagInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyTagInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTagInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTagInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs index bfa72bdc62..9b10e7e8eb 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTodoItemInRequest : IBackedModel, IParsable + public class ToManyTodoItemInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyTodoItemInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTodoItemInRequest() { @@ -36,12 +39,12 @@ public ToManyTodoItemInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTodoItemInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTodoItemInRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs index 5a479c145d..436bf2adc5 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTodoItemInResponse : IBackedModel, IParsable + public class ToManyTodoItemInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyTodoItemInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTodoItemInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyTodoItemInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTodoItemInResponse() { @@ -64,12 +71,12 @@ public ToManyTodoItemInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTodoItemInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTodoItemInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyTodoItemInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs index 560f0ff471..0cafabe1d9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyTodoItemInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyTodoItemInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyTodoItemInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyTodoItemInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyTodoItemInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyTodoItemInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs index fae137369e..c48b551f2e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOnePersonInRequest : IBackedModel, IParsable + public class ToOnePersonInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToOnePersonInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOnePersonInRequest() { @@ -36,12 +39,12 @@ public ToOnePersonInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOnePersonInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOnePersonInRequest(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs index c2fd01aabe..bc302be9f1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOnePersonInResponse : IBackedModel, IParsable + public class ToOnePersonInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToOnePersonInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PersonIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PersonIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOnePersonInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToOnePersonInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOnePersonInResponse() { @@ -64,12 +71,12 @@ public ToOnePersonInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOnePersonInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOnePersonInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PersonIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs index 00e61ee198..38da624af8 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOnePersonInResponse_meta() { @@ -28,12 +30,12 @@ public ToOnePersonInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOnePersonInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInResponse.cs index 2919e5a212..ae998fcf1b 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAttributesInResponse.cs @@ -5,49 +5,56 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemAttributesInResponse : IBackedModel, IParsable + public class TodoItemAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The createdAt property - public DateTimeOffset? CreatedAt { + public DateTimeOffset? CreatedAt + { get { return BackingStore?.Get("createdAt"); } set { BackingStore?.Set("createdAt", value); } } /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The durationInHours property - public long? DurationInHours { + public long? DurationInHours + { get { return BackingStore?.Get("durationInHours"); } set { BackingStore?.Set("durationInHours", value); } } /// The modifiedAt property - public DateTimeOffset? ModifiedAt { + public DateTimeOffset? ModifiedAt + { get { return BackingStore?.Get("modifiedAt"); } set { BackingStore?.Set("modifiedAt", value); } } /// The priority property - public TodoItemPriority? Priority { - get { return BackingStore?.Get("priority"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPriority? Priority + { + get { return BackingStore?.Get("priority"); } set { BackingStore?.Set("priority", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemAttributesInResponse() { @@ -56,12 +63,12 @@ public TodoItemAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemAttributesInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse(); } /// /// The deserialization information for the current model @@ -71,11 +78,11 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"createdAt", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, - {"description", n => { Description = n.GetStringValue(); } }, - {"durationInHours", n => { DurationInHours = n.GetLongValue(); } }, - {"modifiedAt", n => { ModifiedAt = n.GetDateTimeOffsetValue(); } }, - {"priority", n => { Priority = n.GetEnumValue(); } }, + { "createdAt", n => { CreatedAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "durationInHours", n => { DurationInHours = n.GetLongValue(); } }, + { "modifiedAt", n => { ModifiedAt = n.GetDateTimeOffsetValue(); } }, + { "priority", n => { Priority = n.GetEnumValue(); } }, }; } /// @@ -89,7 +96,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("description", Description); writer.WriteLongValue("durationInHours", DurationInHours); writer.WriteDateTimeOffsetValue("modifiedAt", ModifiedAt); - writer.WriteEnumValue("priority", Priority); + writer.WriteEnumValue("priority", Priority); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs index 7f3c320f09..e7bffcdfa4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemCollectionResponseDocument : IBackedModel, IParsable + public class TodoItemCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TodoItemCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TodoItemCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemCollectionResponseDocument() { @@ -78,12 +87,12 @@ public TodoItemCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemCollectionResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TodoItemDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TodoItemCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs index 0ee622eb95..eb3c64625b 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TodoItemCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public TodoItemCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemCollectionResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs index fa175222f5..7d37cf6f06 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemDataInResponse : DataInResponse, IParsable + public class TodoItemDataInResponse : OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TodoItemAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TodoItemDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public TodoItemRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new TodoItemDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemDataInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(TodoItemAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TodoItemDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TodoItemRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs index d48e2eeaa4..6cba3aea9c 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TodoItemDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemDataInResponse_meta() { @@ -28,12 +30,12 @@ public TodoItemDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemDataInResponse_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs index 6089e16987..6c21782e06 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemIdentifier : IBackedModel, IParsable + public class TodoItemIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class TodoItemIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public TodoItemResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemIdentifier() { @@ -41,12 +45,12 @@ public TodoItemIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs index 003ac6aeb1..bb1a4d5e99 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class TodoItemIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class TodoItemIdentifierCollectionResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TodoItemIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public TodoItemIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemIdentifierCollectionResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TodoItemIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs index f1fab6517c..da00e6a419 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TodoItemIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public TodoItemIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs index 8839449a4c..88c6445519 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemPrimaryResponseDocument : IBackedModel, IParsable + public class TodoItemPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TodoItemPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItems? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TodoItems Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TodoItemPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TodoItemPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public TodoItemPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemPrimaryResponseDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TodoItems.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TodoItemPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs index b26f09c1f8..5a93bd7dc8 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TodoItemPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public TodoItemPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemPrimaryResponseDocument_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPriority.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPriority.cs index 2cc04c37e7..89e60427c9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPriority.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPriority.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum TodoItemPriority #pragma warning restore CS1591 diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInResponse.cs index 1dda20dd6b..32526a40b0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TodoItemRelationshipsInResponse : IBackedModel, IParsable + public class TodoItemRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The assignee property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOnePersonInResponse? Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse? Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #nullable restore #else - public NullableToOnePersonInResponse Assignee { - get { return BackingStore?.Get("assignee"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse Assignee + { + get { return BackingStore?.Get("assignee"); } set { BackingStore?.Set("assignee", value); } } #endif @@ -29,33 +32,37 @@ public NullableToOnePersonInResponse Assignee { /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOnePersonInResponse? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOnePersonInResponse Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyTagInResponse? Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse? Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public ToManyTagInResponse Tags { - get { return BackingStore?.Get("tags"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse Tags + { + get { return BackingStore?.Get("tags"); } set { BackingStore?.Set("tags", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TodoItemRelationshipsInResponse() { @@ -64,12 +71,12 @@ public TodoItemRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TodoItemRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItemRelationshipsInResponse(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"assignee", n => { Assignee = n.GetObjectValue(NullableToOnePersonInResponse.CreateFromDiscriminatorValue); } }, - {"owner", n => { Owner = n.GetObjectValue(ToOnePersonInResponse.CreateFromDiscriminatorValue); } }, - {"tags", n => { Tags = n.GetObjectValue(ToManyTagInResponse.CreateFromDiscriminatorValue); } }, + { "assignee", n => { Assignee = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse.CreateFromDiscriminatorValue); } }, + { "tags", n => { Tags = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("assignee", Assignee); - writer.WriteObjectValue("owner", Owner); - writer.WriteObjectValue("tags", Tags); + writer.WriteObjectValue("assignee", Assignee); + writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("tags", Tags); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemResourceType.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemResourceType.cs index 7eaec5b945..4e8edcb9eb 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemResourceType.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum TodoItemResourceType #pragma warning restore CS1591 diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems.cs deleted file mode 100644 index eddca55b7d..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class TodoItems : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TodoItemAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public TodoItemAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TodoItems_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public TodoItems_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TodoItemRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public TodoItemRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new TodoItems CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItems(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(TodoItemAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TodoItems_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(TodoItemRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems_meta.cs deleted file mode 100644 index 57adcd5aa8..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItems_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { - #pragma warning disable CS1591 - public class TodoItems_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TodoItems_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static TodoItems_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TodoItems_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs index ff1dc40a0d..cd595f29e9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdatePersonRequestDocument : IBackedModel, IParsable + public class UpdatePersonRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdatePersonRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdatePersonRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdatePersonRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdatePersonRequestDocument() { @@ -36,12 +39,12 @@ public UpdatePersonRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdatePersonRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs index 01d122b7b0..a2611caf29 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateTagRequestDocument : IBackedModel, IParsable + public class UpdateTagRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateTagRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateTagRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateTagRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateTagRequestDocument() { @@ -36,12 +39,12 @@ public UpdateTagRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateTagRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateTagRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs index 50faf9e965..1529e31a49 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models { +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateTodoItemRequestDocument : IBackedModel, IParsable + public class UpdateTodoItemRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateTodoItemRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateTodoItemRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateTodoItemRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateTodoItemRequestDocument() { @@ -36,12 +39,12 @@ public UpdateTodoItemRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateTodoItemRequestDocument(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/ClientIdGenerationModesClient.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/ClientIdGenerationModesClient.cs index 809efaf425..57904ec837 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/ClientIdGenerationModesClient.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/ClientIdGenerationModesClient.cs @@ -14,29 +14,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class ClientIdGenerationModesClient : BaseRequestBuilder + public class ClientIdGenerationModesClient : BaseRequestBuilder { /// The games property - public GamesRequestBuilder Games + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games.GamesRequestBuilder Games { - get => new GamesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games.GamesRequestBuilder(PathParameters, RequestAdapter); } /// The playerGroups property - public PlayerGroupsRequestBuilder PlayerGroups + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups.PlayerGroupsRequestBuilder PlayerGroups { - get => new PlayerGroupsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups.PlayerGroupsRequestBuilder(PathParameters, RequestAdapter); } /// The players property - public PlayersRequestBuilder Players + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players.PlayersRequestBuilder Players { - get => new PlayersRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players.PlayersRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs index f62ef77881..e869c90b2f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Games/GamesRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games +{ /// /// Builds and executes requests for operations under \games /// - public class GamesRequestBuilder : BaseRequestBuilder + public class GamesRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public GamesRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,33 +34,33 @@ public GamesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Creates a new game. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateGameRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateGameRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, GamePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new game. @@ -69,11 +70,11 @@ public async Task PostAsync(CreateGameRequestDocume /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateGameRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateGameRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -86,11 +87,11 @@ public RequestInformation ToPostRequestInformation(CreateGameRequestDocument bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public GamesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games.GamesRequestBuilder WithUrl(string rawUrl) { - return new GamesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Games.GamesRequestBuilder(rawUrl, RequestAdapter); } /// /// Creates a new game. diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs index 917d048963..c658809ba7 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreateGameRequest.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateGameRequest : IBackedModel, IParsable + public class AttributesInCreateGameRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The purchasePrice property - public double? PurchasePrice { + public double? PurchasePrice + { get { return BackingStore?.Get("purchasePrice"); } set { BackingStore?.Set("purchasePrice", value); } } /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateGameRequest() { @@ -41,12 +45,12 @@ public AttributesInCreateGameRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateGameRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreateGameRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"purchasePrice", n => { PurchasePrice = n.GetDoubleValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "purchasePrice", n => { PurchasePrice = n.GetDoubleValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs index 4d829b23c5..3d634c5b1c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerGroupRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreatePlayerGroupRequest : IBackedModel, IParsable + public class AttributesInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class AttributesInCreatePlayerGroupRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreatePlayerGroupRequest() { @@ -36,12 +39,12 @@ public AttributesInCreatePlayerGroupRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreatePlayerGroupRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs index c228d13196..73f45b215f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/AttributesInCreatePlayerRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreatePlayerRequest : IBackedModel, IParsable + public class AttributesInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class AttributesInCreatePlayerRequest : IBackedModel, IParsable /// The userName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? UserName { + public string? UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #nullable restore #else - public string UserName { + public string UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreatePlayerRequest() { @@ -36,12 +39,12 @@ public AttributesInCreatePlayerRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreatePlayerRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"userName", n => { UserName = n.GetStringValue(); } }, + { "userName", n => { UserName = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs index 74fd5c8ff2..dcd010a78a 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreateGameRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateGameRequestDocument : IBackedModel, IParsable + public class CreateGameRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateGameRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateGameRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreateGameRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateGameRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreateGameRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateGameRequestDocument() { @@ -36,12 +39,12 @@ public CreateGameRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateGameRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateGameRequestDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreateGameRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateGameRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreateGameRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs index 103812b4b3..f52a6797c2 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerGroupRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreatePlayerGroupRequestDocument : IBackedModel, IParsable + public class CreatePlayerGroupRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreatePlayerGroupRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreatePlayerGroupRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerGroupRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreatePlayerGroupRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerGroupRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreatePlayerGroupRequestDocument() { @@ -36,12 +39,12 @@ public CreatePlayerGroupRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreatePlayerGroupRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreatePlayerGroupRequestDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs index b33a707ce6..58030abe68 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/CreatePlayerRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreatePlayerRequestDocument : IBackedModel, IParsable + public class CreatePlayerRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreatePlayerRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreatePlayerRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreatePlayerRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreatePlayerRequestDocument() { @@ -36,12 +39,12 @@ public CreatePlayerRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreatePlayerRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreatePlayerRequestDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs index 8a649fdf47..1079f5693c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreateGameRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateGameRequest : IBackedModel, IParsable + public class DataInCreateGameRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateGameRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreateGameRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateGameRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreateGameRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateGameRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public GameResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateGameRequest() { @@ -55,12 +61,12 @@ public DataInCreateGameRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreateGameRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateGameRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreateGameRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateGameRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreateGameRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs index 4c00107822..b1d3293c00 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerGroupRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreatePlayerGroupRequest : IBackedModel, IParsable + public class DataInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreatePlayerGroupRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerGroupRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreatePlayerGroupRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerGroupRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreatePlayerGroupRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreatePlayerGroupRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerGroupRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreatePlayerGroupRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerGroupRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public PlayerGroupResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreatePlayerGroupRequest() { @@ -55,12 +61,12 @@ public DataInCreatePlayerGroupRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreatePlayerGroupRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerGroupRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs index 271f6f8207..f6637735a6 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInCreatePlayerRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreatePlayerRequest : IBackedModel, IParsable + public class DataInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreatePlayerRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreatePlayerRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInCreatePlayerRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreatePlayerRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreatePlayerRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public PlayerResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreatePlayerRequest() { @@ -69,12 +77,12 @@ public DataInCreatePlayerRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreatePlayerRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInCreatePlayerRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.AttributesInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs index 331c29df4f..16f4f3e087 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,18 +55,18 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "games" => new GameDataInResponse(), - "playerGroups" => new PlayerGroupDataInResponse(), - "players" => new PlayerDataInResponse(), - _ => new DataInResponse(), + "games" => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse(), + "playerGroups" => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse(), + "players" => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse(), }; } /// @@ -72,8 +77,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorLinks.cs index 8ef2ae8a4d..1876a5897c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs index 9b10f62cba..87012f04b5 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs index 342caaa368..36e4bdedeb 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs index 80808bb2de..389b7bd2d6 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs index debf017e57..ae59e31f93 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorSource.cs index d00ccba5b0..d7233e8fa2 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorTopLevelLinks.cs index 0ef50b38a6..2cb1a72fcd 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInResponse.cs index d6015cd7e2..f9a498ba02 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameAttributesInResponse.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GameAttributesInResponse : IBackedModel, IParsable + public class GameAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The purchasePrice property - public double? PurchasePrice { + public double? PurchasePrice + { get { return BackingStore?.Get("purchasePrice"); } set { BackingStore?.Set("purchasePrice", value); } } /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public GameAttributesInResponse() { @@ -41,12 +45,12 @@ public GameAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GameAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"purchasePrice", n => { PurchasePrice = n.GetDoubleValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "purchasePrice", n => { PurchasePrice = n.GetDoubleValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs index a43b36aff6..e234ad3512 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GameDataInResponse : DataInResponse, IParsable + public class GameDataInResponse : OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public GameAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public GameAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public GameDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public GameDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new GameDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameDataInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(GameAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(GameDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs index 1700e7e3f6..bc92d806df 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GameDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class GameDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public GameDataInResponse_meta() { @@ -28,12 +30,12 @@ public GameDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GameDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs index 6c31e77d75..0475531b0a 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GameIdentifier : IBackedModel, IParsable + public class GameIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class GameIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public GameResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public GameIdentifier() { @@ -41,12 +45,12 @@ public GameIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GameIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GameIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs index 6ff16e0fe9..0630b434b3 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GamePrimaryResponseDocument : IBackedModel, IParsable + public class GamePrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class GamePrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Games? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Games Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public GamePrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public GamePrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public GamePrimaryResponseDocument() { @@ -78,12 +87,12 @@ public GamePrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GamePrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GamePrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Games.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(GamePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs index 9340b6c52c..d562854a1c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class GamePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class GamePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public GamePrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public GamePrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static GamePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new GamePrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameResourceType.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameResourceType.cs index ccccb275ca..b02594c28c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum GameResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games.cs deleted file mode 100644 index 947a63a568..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Games : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public GameAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public GameAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Games_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Games_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Games CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Games(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(GameAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Games_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games_meta.cs deleted file mode 100644 index d886c4337e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Games_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Games_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Games_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Games_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Games_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInResponse.cs index a527f37ef9..8e6bd01818 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerAttributesInResponse : IBackedModel, IParsable + public class PlayerAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class PlayerAttributesInResponse : IBackedModel, IParsable /// The userName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? UserName { + public string? UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #nullable restore #else - public string UserName { + public string UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerAttributesInResponse() { @@ -36,12 +39,12 @@ public PlayerAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"userName", n => { UserName = n.GetStringValue(); } }, + { "userName", n => { UserName = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs index d7f1bed501..977cfef0e8 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerDataInResponse : DataInResponse, IParsable + public class PlayerDataInResponse : OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PlayerAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PlayerDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PlayerRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new PlayerDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerDataInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PlayerDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs index 676f67d671..257b303604 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PlayerDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerDataInResponse_meta() { @@ -28,12 +30,12 @@ public PlayerDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInResponse.cs index 4ae909a6f0..d74377ed2f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupAttributesInResponse : IBackedModel, IParsable + public class PlayerGroupAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class PlayerGroupAttributesInResponse : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupAttributesInResponse() { @@ -36,12 +39,12 @@ public PlayerGroupAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs index 562c096d2c..4b21e4a36b 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupDataInResponse : DataInResponse, IParsable + public class PlayerGroupDataInResponse : OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public PlayerGroupAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PlayerGroupDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public PlayerGroupRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new PlayerGroupDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupDataInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerGroupAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PlayerGroupDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerGroupRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs index 2ecfbd92bf..9cf8f0c6f7 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PlayerGroupDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupDataInResponse_meta() { @@ -28,12 +30,12 @@ public PlayerGroupDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs index bae65b3c9b..717ee59e79 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupIdentifier : IBackedModel, IParsable + public class PlayerGroupIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class PlayerGroupIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public PlayerGroupResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupIdentifier() { @@ -41,12 +45,12 @@ public PlayerGroupIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs index 6900d50e6a..30b5b105ed 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupPrimaryResponseDocument : IBackedModel, IParsable + public class PlayerGroupPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class PlayerGroupPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroups? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public PlayerGroups Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerGroupPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PlayerGroupPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public PlayerGroupPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(PlayerGroups.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PlayerGroupPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs index 283f9fe549..88b112e338 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PlayerGroupPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public PlayerGroupPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInResponse.cs index 2a08005052..31de48df91 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerGroupRelationshipsInResponse : IBackedModel, IParsable + public class PlayerGroupRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class PlayerGroupRelationshipsInResponse : IBackedModel, IParsable /// The players property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerInResponse? Players { - get { return BackingStore?.Get("players"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse? Players + { + get { return BackingStore?.Get("players"); } set { BackingStore?.Set("players", value); } } #nullable restore #else - public ToManyPlayerInResponse Players { - get { return BackingStore?.Get("players"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse Players + { + get { return BackingStore?.Get("players"); } set { BackingStore?.Set("players", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerGroupRelationshipsInResponse() { @@ -36,12 +39,12 @@ public PlayerGroupRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerGroupRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroupRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"players", n => { Players = n.GetObjectValue(ToManyPlayerInResponse.CreateFromDiscriminatorValue); } }, + { "players", n => { Players = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("players", Players); + writer.WriteObjectValue("players", Players); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupResourceType.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupResourceType.cs index 2f1fb2e6e8..26e3c2806c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum PlayerGroupResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups.cs deleted file mode 100644 index a2d0e3f8ab..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class PlayerGroups : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PlayerGroupAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public PlayerGroupAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PlayerGroups_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public PlayerGroups_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PlayerGroupRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public PlayerGroupRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new PlayerGroups CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroups(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerGroupAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PlayerGroups_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerGroupRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups_meta.cs deleted file mode 100644 index 37fb349fa1..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroups_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class PlayerGroups_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PlayerGroups_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static PlayerGroups_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerGroups_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs index 4a0c0514f0..bd3db3e273 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerIdentifier : IBackedModel, IParsable + public class PlayerIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class PlayerIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public PlayerResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerIdentifier() { @@ -41,12 +45,12 @@ public PlayerIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs index 2b64c45608..05c1d2236c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerPrimaryResponseDocument : IBackedModel, IParsable + public class PlayerPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class PlayerPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Players? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Players Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public PlayerPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public PlayerPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public PlayerPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Players.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(PlayerPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs index bd13e2855d..2de83b41c8 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class PlayerPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public PlayerPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInResponse.cs index 014f4b73db..4647cae83d 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class PlayerRelationshipsInResponse : IBackedModel, IParsable + public class PlayerRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +16,37 @@ public class PlayerRelationshipsInResponse : IBackedModel, IParsable /// The memberOf property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerGroupInResponse? MemberOf { - get { return BackingStore?.Get("memberOf"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse? MemberOf + { + get { return BackingStore?.Get("memberOf"); } set { BackingStore?.Set("memberOf", value); } } #nullable restore #else - public ToManyPlayerGroupInResponse MemberOf { - get { return BackingStore?.Get("memberOf"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse MemberOf + { + get { return BackingStore?.Get("memberOf"); } set { BackingStore?.Set("memberOf", value); } } #endif /// The ownedGames property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyGameInResponse? OwnedGames { - get { return BackingStore?.Get("ownedGames"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse? OwnedGames + { + get { return BackingStore?.Get("ownedGames"); } set { BackingStore?.Set("ownedGames", value); } } #nullable restore #else - public ToManyGameInResponse OwnedGames { - get { return BackingStore?.Get("ownedGames"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse OwnedGames + { + get { return BackingStore?.Get("ownedGames"); } set { BackingStore?.Set("ownedGames", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public PlayerRelationshipsInResponse() { @@ -50,12 +55,12 @@ public PlayerRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static PlayerRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new PlayerRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"memberOf", n => { MemberOf = n.GetObjectValue(ToManyPlayerGroupInResponse.CreateFromDiscriminatorValue); } }, - {"ownedGames", n => { OwnedGames = n.GetObjectValue(ToManyGameInResponse.CreateFromDiscriminatorValue); } }, + { "memberOf", n => { MemberOf = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse.CreateFromDiscriminatorValue); } }, + { "ownedGames", n => { OwnedGames = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -76,8 +81,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("memberOf", MemberOf); - writer.WriteObjectValue("ownedGames", OwnedGames); + writer.WriteObjectValue("memberOf", MemberOf); + writer.WriteObjectValue("ownedGames", OwnedGames); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerResourceType.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerResourceType.cs index 9c73910033..564d0a74f9 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum PlayerResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players.cs deleted file mode 100644 index d9a7ba5f69..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Players : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PlayerAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public PlayerAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Players_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Players_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public PlayerRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public PlayerRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Players CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Players(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(PlayerAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Players_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(PlayerRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players_meta.cs deleted file mode 100644 index f6e1609532..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Players_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Players_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Players_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Players_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Players_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipLinks.cs index a979b39181..7f8c92ff43 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs index ad74308c1c..6ea60fb512 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerGroupRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreatePlayerGroupRequest : IBackedModel, IParsable + public class RelationshipsInCreatePlayerGroupRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInCreatePlayerGroupRequest : IBackedModel, IParsable /// The players property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerInRequest? Players { - get { return BackingStore?.Get("players"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInRequest? Players + { + get { return BackingStore?.Get("players"); } set { BackingStore?.Set("players", value); } } #nullable restore #else - public ToManyPlayerInRequest Players { - get { return BackingStore?.Get("players"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInRequest Players + { + get { return BackingStore?.Get("players"); } set { BackingStore?.Set("players", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreatePlayerGroupRequest() { @@ -36,12 +39,12 @@ public RelationshipsInCreatePlayerGroupRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerGroupRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreatePlayerGroupRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerGroupRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"players", n => { Players = n.GetObjectValue(ToManyPlayerInRequest.CreateFromDiscriminatorValue); } }, + { "players", n => { Players = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("players", Players); + writer.WriteObjectValue("players", Players); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs index 26bb995299..50d012a716 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/RelationshipsInCreatePlayerRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreatePlayerRequest : IBackedModel, IParsable + public class RelationshipsInCreatePlayerRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,33 +16,37 @@ public class RelationshipsInCreatePlayerRequest : IBackedModel, IParsable /// The memberOf property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerGroupInRequest? MemberOf { - get { return BackingStore?.Get("memberOf"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInRequest? MemberOf + { + get { return BackingStore?.Get("memberOf"); } set { BackingStore?.Set("memberOf", value); } } #nullable restore #else - public ToManyPlayerGroupInRequest MemberOf { - get { return BackingStore?.Get("memberOf"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInRequest MemberOf + { + get { return BackingStore?.Get("memberOf"); } set { BackingStore?.Set("memberOf", value); } } #endif /// The ownedGames property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyGameInRequest? OwnedGames { - get { return BackingStore?.Get("ownedGames"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInRequest? OwnedGames + { + get { return BackingStore?.Get("ownedGames"); } set { BackingStore?.Set("ownedGames", value); } } #nullable restore #else - public ToManyGameInRequest OwnedGames { - get { return BackingStore?.Get("ownedGames"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInRequest OwnedGames + { + get { return BackingStore?.Get("ownedGames"); } set { BackingStore?.Set("ownedGames", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreatePlayerRequest() { @@ -50,12 +55,12 @@ public RelationshipsInCreatePlayerRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreatePlayerRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipsInCreatePlayerRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"memberOf", n => { MemberOf = n.GetObjectValue(ToManyPlayerGroupInRequest.CreateFromDiscriminatorValue); } }, - {"ownedGames", n => { OwnedGames = n.GetObjectValue(ToManyGameInRequest.CreateFromDiscriminatorValue); } }, + { "memberOf", n => { MemberOf = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInRequest.CreateFromDiscriminatorValue); } }, + { "ownedGames", n => { OwnedGames = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -76,8 +81,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("memberOf", MemberOf); - writer.WriteObjectValue("ownedGames", OwnedGames); + writer.WriteObjectValue("memberOf", MemberOf); + writer.WriteObjectValue("ownedGames", OwnedGames); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceLinks.cs index 72f2c2273e..b21afe3d69 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceTopLevelLinks.cs index 2fc4a78968..b52cc09b25 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs index 174f7ca23d..88fdf6163b 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyGameInRequest : IBackedModel, IParsable + public class ToManyGameInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyGameInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyGameInRequest() { @@ -36,12 +39,12 @@ public ToManyGameInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyGameInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyGameInRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs index c9a4ed2005..2232ecd983 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyGameInResponse : IBackedModel, IParsable + public class ToManyGameInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyGameInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyGameInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyGameInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyGameInResponse() { @@ -64,12 +71,12 @@ public ToManyGameInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyGameInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyGameInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyGameInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs index 3fe825de9d..f2b5c7be46 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyGameInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyGameInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyGameInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyGameInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyGameInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyGameInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs index 1bfb54c7db..04c22d1fa5 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerGroupInRequest : IBackedModel, IParsable + public class ToManyPlayerGroupInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyPlayerGroupInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerGroupInRequest() { @@ -36,12 +39,12 @@ public ToManyPlayerGroupInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerGroupInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerGroupInRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs index 610ae2ef62..b62f0bfcc6 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerGroupInResponse : IBackedModel, IParsable + public class ToManyPlayerGroupInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyPlayerGroupInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerGroupInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyPlayerGroupInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerGroupInResponse() { @@ -64,12 +71,12 @@ public ToManyPlayerGroupInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerGroupInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerGroupInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyPlayerGroupInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs index 4945b9e3dc..1ea3639ba7 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerGroupInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyPlayerGroupInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerGroupInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyPlayerGroupInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerGroupInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerGroupInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs index bb95365cd1..044f670f25 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerInRequest : IBackedModel, IParsable + public class ToManyPlayerInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyPlayerInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerInRequest() { @@ -36,12 +39,12 @@ public ToManyPlayerInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerInRequest(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs index d35d0a9024..4423dc2fe3 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerInResponse : IBackedModel, IParsable + public class ToManyPlayerInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyPlayerInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyPlayerInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyPlayerInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerInResponse() { @@ -64,12 +71,12 @@ public ToManyPlayerInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerInResponse(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyPlayerInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs index b12bca4fbc..d0124b20cd 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyPlayerInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyPlayerInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyPlayerInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyPlayerInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyPlayerInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyPlayerInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs index 07d887ef9c..5e7676ac5c 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/PlayerGroups/PlayerGroupsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups +{ /// /// Builds and executes requests for operations under \playerGroups /// - public class PlayerGroupsRequestBuilder : BaseRequestBuilder + public class PlayerGroupsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public PlayerGroupsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,35 +34,35 @@ public PlayerGroupsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Creates a new playerGroup. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PlayerGroupPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new playerGroup. @@ -71,11 +72,11 @@ public async Task PostAsync(CreatePlayerGrou /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerGroupRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -88,11 +89,11 @@ public RequestInformation ToPostRequestInformation(CreatePlayerGroupRequestDocum /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public PlayerGroupsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups.PlayerGroupsRequestBuilder WithUrl(string rawUrl) { - return new PlayerGroupsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.PlayerGroups.PlayerGroupsRequestBuilder(rawUrl, RequestAdapter); } /// /// Creates a new playerGroup. diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs index 3f54591d5b..491402b8df 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Players/PlayersRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players { +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players +{ /// /// Builds and executes requests for operations under \players /// - public class PlayersRequestBuilder : BaseRequestBuilder + public class PlayersRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public PlayersRequestBuilder(Dictionary pathParameters, IRequest { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,33 +34,33 @@ public PlayersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : ba /// /// Creates a new player. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreatePlayerRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreatePlayerRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, PlayerPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new player. @@ -69,11 +70,11 @@ public async Task PostAsync(CreatePlayerRequestDo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreatePlayerRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreatePlayerRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.CreatePlayerRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -86,11 +87,11 @@ public RequestInformation ToPostRequestInformation(CreatePlayerRequestDocument b /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public PlayersRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players.PlayersRequestBuilder WithUrl(string rawUrl) { - return new PlayersRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Players.PlayersRequestBuilder(rawUrl, RequestAdapter); } /// /// Creates a new player. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs index 853db58113..5598cf745c 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/CountriesRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries +{ /// /// Builds and executes requests for operations under \countries /// - public class CountriesRequestBuilder : BaseRequestBuilder + public class CountriesRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.Headers.GeneratedCode.countries.item collection /// The identifier of the country to retrieve. - /// A - public CountriesItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.CountriesItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new CountriesItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.CountriesItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public CountriesRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public CountriesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves a collection of countries. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, CountryCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new country. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of countries. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateCountryRequest /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateCountryRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateCountryRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateCountryRequestDocument /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public CountriesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.CountriesRequestBuilder WithUrl(string rawUrl) { - return new CountriesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.CountriesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of countries. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs index 048bbd2f1b..88b95726cc 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/CountriesItemRequestBuilder.cs @@ -10,24 +10,25 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item +{ /// /// Builds and executes requests for operations under \countries\{id} /// - public class CountriesItemRequestBuilder : BaseRequestBuilder + public class CountriesItemRequestBuilder : BaseRequestBuilder { /// The languages property - public LanguagesRequestBuilder Languages + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages.LanguagesRequestBuilder Languages { - get => new LanguagesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages.LanguagesRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public CountriesItemRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public CountriesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -60,34 +61,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual country by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -96,11 +97,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -109,33 +110,33 @@ public async Task HeadAsync(Action /// Updates an existing country. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing country by its identifier. @@ -163,11 +164,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -182,11 +183,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -201,11 +202,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateCountryRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateCountryRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -218,11 +219,11 @@ public RequestInformation ToPatchRequestInformation(UpdateCountryRequestDocument /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public CountriesItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.CountriesItemRequestBuilder WithUrl(string rawUrl) { - return new CountriesItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.CountriesItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual country by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Languages/LanguagesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Languages/LanguagesRequestBuilder.cs index 395e1a109b..89f674b247 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Languages/LanguagesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Languages/LanguagesRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages +{ /// /// Builds and executes requests for operations under \countries\{id}\languages /// - public class LanguagesRequestBuilder : BaseRequestBuilder + public class LanguagesRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public LanguagesRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public LanguagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves the related languages of an individual country's languages relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, LanguageCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public LanguagesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages.LanguagesRequestBuilder WithUrl(string rawUrl) { - return new LanguagesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Languages.LanguagesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related languages of an individual country's languages relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/Languages/LanguagesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/Languages/LanguagesRequestBuilder.cs index 3a6a9400a6..cb42d993d7 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/Languages/LanguagesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/Languages/LanguagesRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages +{ /// /// Builds and executes requests for operations under \countries\{id}\relationships\languages /// - public class LanguagesRequestBuilder : BaseRequestBuilder + public class LanguagesRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public LanguagesRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public LanguagesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related language identities of an individual country's languages relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, LanguageIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyLanguageInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyLanguageInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyLanguageInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyLanguageInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyLanguageInRequest bod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyLanguageInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyLanguageInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyLanguageInRequest body /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyLanguageInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyLanguageInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyLanguageInRequest body, /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public LanguagesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages.LanguagesRequestBuilder WithUrl(string rawUrl) { - return new LanguagesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages.LanguagesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related language identities of an individual country's languages relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/RelationshipsRequestBuilder.cs index 741e8191c5..4fe4c2b353 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Countries/Item/Relationships/RelationshipsRequestBuilder.cs @@ -6,19 +6,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships +{ /// /// Builds and executes requests for operations under \countries\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The languages property - public LanguagesRequestBuilder Languages + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages.LanguagesRequestBuilder Languages { - get => new LanguagesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.Item.Relationships.Languages.LanguagesRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -26,7 +27,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/HeadersClient.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/HeadersClient.cs index 8b0d87a0a2..26e8a21c61 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/HeadersClient.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/HeadersClient.cs @@ -12,19 +12,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class HeadersClient : BaseRequestBuilder + public class HeadersClient : BaseRequestBuilder { /// The countries property - public CountriesRequestBuilder Countries + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.CountriesRequestBuilder Countries { - get => new CountriesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Countries.CountriesRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs index 5afaf15a90..890c4e9031 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInCreateCountryRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateCountryRequest : IBackedModel, IParsable + public class AttributesInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class AttributesInCreateCountryRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// The population property - public long? Population { + public long? Population + { get { return BackingStore?.Get("population"); } set { BackingStore?.Set("population", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateCountryRequest() { @@ -41,12 +45,12 @@ public AttributesInCreateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInCreateCountryRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"population", n => { Population = n.GetLongValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "population", n => { Population = n.GetLongValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs index 54889cf6c7..26a8538a76 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/AttributesInUpdateCountryRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateCountryRequest : IBackedModel, IParsable + public class AttributesInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class AttributesInUpdateCountryRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// The population property - public long? Population { + public long? Population + { get { return BackingStore?.Get("population"); } set { BackingStore?.Set("population", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateCountryRequest() { @@ -41,12 +45,12 @@ public AttributesInUpdateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInUpdateCountryRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"population", n => { Population = n.GetLongValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "population", n => { Population = n.GetLongValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries.cs deleted file mode 100644 index 742ad1c9c2..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Countries : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public CountryAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public CountryAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Countries_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Countries_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public CountryRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public CountryRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Countries CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Countries(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(CountryAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Countries_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(CountryRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries_meta.cs deleted file mode 100644 index c9e89c6a88..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Countries_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Countries_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Countries_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Countries_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Countries_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInResponse.cs index d758e2ee46..c84aa0e8ff 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryAttributesInResponse : IBackedModel, IParsable + public class CountryAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class CountryAttributesInResponse : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// The population property - public long? Population { + public long? Population + { get { return BackingStore?.Get("population"); } set { BackingStore?.Set("population", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryAttributesInResponse() { @@ -41,12 +45,12 @@ public CountryAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"population", n => { Population = n.GetLongValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "population", n => { Population = n.GetLongValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs index 3bd5239c50..c8bddf483a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryCollectionResponseDocument : IBackedModel, IParsable + public class CountryCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class CountryCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public CountryCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryCollectionResponseDocument() { @@ -78,12 +87,12 @@ public CountryCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(CountryDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(CountryCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs index c7cea762b3..d8575601e4 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class CountryCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public CountryCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs index fe1b5c07c5..7aabb9b4e2 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryDataInResponse : DataInResponse, IParsable + public class CountryDataInResponse : OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public CountryAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public CountryDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public CountryRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new CountryDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryDataInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(CountryAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(CountryDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(CountryRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs index 4f3f443624..4319a3b2f5 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class CountryDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryDataInResponse_meta() { @@ -28,12 +30,12 @@ public CountryDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs index 7bfcc41e67..b42629dafc 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryPrimaryResponseDocument : IBackedModel, IParsable + public class CountryPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class CountryPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Countries? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Countries Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public CountryPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public CountryPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public CountryPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Countries.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(CountryPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs index 5dd23323e5..fcd93996e4 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class CountryPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public CountryPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInResponse.cs index 94e3d467d6..ba278238c0 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CountryRelationshipsInResponse : IBackedModel, IParsable + public class CountryRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CountryRelationshipsInResponse : IBackedModel, IParsable /// The languages property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyLanguageInResponse? Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse? Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #nullable restore #else - public ToManyLanguageInResponse Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CountryRelationshipsInResponse() { @@ -36,12 +39,12 @@ public CountryRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CountryRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CountryRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"languages", n => { Languages = n.GetObjectValue(ToManyLanguageInResponse.CreateFromDiscriminatorValue); } }, + { "languages", n => { Languages = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("languages", Languages); + writer.WriteObjectValue("languages", Languages); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryResourceType.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryResourceType.cs index d68def80fd..10fc7ac2e1 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum CountryResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs index a66bbaec85..5a3997e56a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CreateCountryRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateCountryRequestDocument : IBackedModel, IParsable + public class CreateCountryRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateCountryRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateCountryRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInCreateCountryRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateCountryRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInCreateCountryRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateCountryRequestDocument() { @@ -36,12 +39,12 @@ public CreateCountryRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateCountryRequestDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CreateCountryRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateCountryRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInCreateCountryRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs index 67686df5b0..e1fa66e01e 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInCreateCountryRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateCountryRequest : IBackedModel, IParsable + public class DataInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateCountryRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInCreateCountryRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateCountryRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInCreateCountryRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateCountryRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateCountryRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInCreateCountryRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateCountryRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInCreateCountryRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public CountryResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateCountryRequest() { @@ -55,12 +61,12 @@ public DataInCreateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInCreateCountryRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateCountryRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateCountryRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInCreateCountryRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInCreateCountryRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs index ab70eb51d2..f487354f7d 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,17 +55,17 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "countries" => new CountryDataInResponse(), - "languages" => new LanguageDataInResponse(), - _ => new DataInResponse(), + "countries" => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse(), + "languages" => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse(), }; } /// @@ -71,8 +76,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs index e050d070dc..8f6f7aa128 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInUpdateCountryRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateCountryRequest : IBackedModel, IParsable + public class DataInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateCountryRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInUpdateCountryRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateCountryRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInUpdateCountryRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateCountryRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateCountryRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInUpdateCountryRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateCountryRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInUpdateCountryRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public CountryResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateCountryRequest() { @@ -69,12 +77,12 @@ public DataInUpdateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInUpdateCountryRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.AttributesInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorLinks.cs index a0c27f997c..965711c1dd 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs index f3438b70dd..b1a6305861 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs index da7b3ecab0..157a35b838 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs index d1c0de6faf..df637f86c4 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs index 29c7e027a1..cb35ee37f8 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorSource.cs index 8414708fed..7c33da72e6 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorTopLevelLinks.cs index 47b66a08b9..14f959c641 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageAttributesInResponse.cs index c327c1f1a0..91e378584a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageAttributesInResponse : IBackedModel, IParsable + public class LanguageAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class LanguageAttributesInResponse : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,19 +32,21 @@ public string Code { /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageAttributesInResponse() { @@ -50,12 +55,12 @@ public LanguageAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs index 9f2fcc2bc1..bbf6e9e0e6 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageCollectionResponseDocument : IBackedModel, IParsable + public class LanguageCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class LanguageCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public LanguageCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public LanguageCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageCollectionResponseDocument() { @@ -78,12 +87,12 @@ public LanguageCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(LanguageDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(LanguageCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs index 33fa870faf..2fa5399420 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class LanguageCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public LanguageCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs index d61108f453..0a3f9be3b9 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageDataInResponse : DataInResponse, IParsable + public class LanguageDataInResponse : OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public LanguageAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public LanguageAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public LanguageDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public LanguageDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new LanguageDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageDataInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(LanguageAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(LanguageDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs index fd49815039..2d0960656e 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class LanguageDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageDataInResponse_meta() { @@ -28,12 +30,12 @@ public LanguageDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs index b96a4406e1..62d4a68bdb 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageIdentifier : IBackedModel, IParsable + public class LanguageIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class LanguageIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public LanguageResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageIdentifier() { @@ -41,12 +45,12 @@ public LanguageIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageIdentifier(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs index d73551d119..feb80c750a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class LanguageIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class LanguageIdentifierCollectionResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public LanguageIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public LanguageIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public LanguageIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageIdentifierCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(LanguageIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs index 017598f475..eb439ecb58 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class LanguageIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class LanguageIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public LanguageIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public LanguageIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static LanguageIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new LanguageIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageResourceType.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageResourceType.cs index 8c2d9e703c..5c9014b758 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum LanguageResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipLinks.cs index 6d4239c004..e6745242c9 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs index 05f0d50abe..64cf268db9 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInCreateCountryRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateCountryRequest : IBackedModel, IParsable + public class RelationshipsInCreateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInCreateCountryRequest : IBackedModel, IParsable /// The languages property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyLanguageInRequest? Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest? Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #nullable restore #else - public ToManyLanguageInRequest Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateCountryRequest() { @@ -36,12 +39,12 @@ public RelationshipsInCreateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInCreateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInCreateCountryRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"languages", n => { Languages = n.GetObjectValue(ToManyLanguageInRequest.CreateFromDiscriminatorValue); } }, + { "languages", n => { Languages = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("languages", Languages); + writer.WriteObjectValue("languages", Languages); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs index 73ceccabc4..b53bb673a5 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/RelationshipsInUpdateCountryRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateCountryRequest : IBackedModel, IParsable + public class RelationshipsInUpdateCountryRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInUpdateCountryRequest : IBackedModel, IParsable /// The languages property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyLanguageInRequest? Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest? Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #nullable restore #else - public ToManyLanguageInRequest Languages { - get { return BackingStore?.Get("languages"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest Languages + { + get { return BackingStore?.Get("languages"); } set { BackingStore?.Set("languages", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateCountryRequest() { @@ -36,12 +39,12 @@ public RelationshipsInUpdateCountryRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInUpdateCountryRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateCountryRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipsInUpdateCountryRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"languages", n => { Languages = n.GetObjectValue(ToManyLanguageInRequest.CreateFromDiscriminatorValue); } }, + { "languages", n => { Languages = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("languages", Languages); + writer.WriteObjectValue("languages", Languages); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs index 14a484c91d..4a5038ecfd 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,19 +96,21 @@ public string Prev { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceCollectionTopLevelLinks() { @@ -106,12 +119,12 @@ public ResourceCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -121,12 +134,12 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs index 0678284a56..717c80d65c 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,13 +96,15 @@ public string Prev { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -99,19 +112,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierCollectionTopLevelLinks() { @@ -120,12 +135,12 @@ public ResourceIdentifierCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -135,13 +150,13 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceLinks.cs index dcf39e8ae9..9bd0f7ca8a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceTopLevelLinks.cs index 1c3b563a16..1d1b53d1fd 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs index c41dc30c41..7ad72387d7 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyLanguageInRequest : IBackedModel, IParsable + public class ToManyLanguageInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyLanguageInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyLanguageInRequest() { @@ -36,12 +39,12 @@ public ToManyLanguageInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyLanguageInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyLanguageInRequest(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs index d795fdf728..d1c34563e6 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyLanguageInResponse : IBackedModel, IParsable + public class ToManyLanguageInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyLanguageInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyLanguageInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyLanguageInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyLanguageInResponse() { @@ -64,12 +71,12 @@ public ToManyLanguageInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyLanguageInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyLanguageInResponse(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyLanguageInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs index a778fb1fd1..42c5f0b7ad 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyLanguageInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyLanguageInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyLanguageInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyLanguageInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyLanguageInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyLanguageInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs index 32382b47e0..3b83a4b03a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/UpdateCountryRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateCountryRequestDocument : IBackedModel, IParsable + public class UpdateCountryRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateCountryRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateCountryRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInUpdateCountryRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateCountryRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInUpdateCountryRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateCountryRequestDocument() { @@ -36,12 +39,12 @@ public UpdateCountryRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateCountryRequestDocument(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.UpdateCountryRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInUpdateCountryRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs index 9bfffb8ab4..25313b5f34 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/AccommodationsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations +{ /// /// Builds and executes requests for operations under \accommodations /// - public class AccommodationsRequestBuilder : BaseRequestBuilder + public class AccommodationsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.Links.GeneratedCode.accommodations.item collection /// The identifier of the accommodation to retrieve. - /// A - public AccommodationsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item.AccommodationsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new AccommodationsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item.AccommodationsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public AccommodationsRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public AccommodationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// /// Retrieves a collection of accommodations. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new accommodation. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of accommodations. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateAccommod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateAccommodationRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateAccommodationRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateAccommodationRequestDoc /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AccommodationsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.AccommodationsRequestBuilder WithUrl(string rawUrl) { - return new AccommodationsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.AccommodationsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of accommodations. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs index 755d441541..20f8b05f0a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Accommodations/Item/AccommodationsItemRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item +{ /// /// Builds and executes requests for operations under \accommodations\{id} /// - public class AccommodationsItemRequestBuilder : BaseRequestBuilder + public class AccommodationsItemRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AccommodationsItemRequestBuilder(Dictionary pathParameter { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public AccommodationsItemRequestBuilder(string rawUrl, IRequestAdapter requestAd /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -48,34 +49,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual accommodation by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -84,11 +85,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -97,33 +98,33 @@ public async Task HeadAsync(Action /// Updates an existing accommodation. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing accommodation by its identifier. @@ -151,11 +152,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -170,11 +171,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -189,11 +190,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateAccommodationRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -206,11 +207,11 @@ public RequestInformation ToPatchRequestInformation(UpdateAccommodationRequestDo /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AccommodationsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item.AccommodationsItemRequestBuilder WithUrl(string rawUrl) { - return new AccommodationsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.Item.AccommodationsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual accommodation by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs index 464b420f01..87db4e310f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/ExcursionsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions +{ /// /// Builds and executes requests for operations under \excursions /// - public class ExcursionsRequestBuilder : BaseRequestBuilder + public class ExcursionsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.Links.GeneratedCode.excursions.item collection /// The identifier of the excursion to retrieve. - /// A - public ExcursionsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item.ExcursionsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new ExcursionsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item.ExcursionsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public ExcursionsRequestBuilder(Dictionary pathParameters, IRequ { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public ExcursionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves a collection of excursions. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new excursion. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of excursions. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateExcursionReq /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateExcursionRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateExcursionRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateExcursionRequestDocumen /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ExcursionsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.ExcursionsRequestBuilder WithUrl(string rawUrl) { - return new ExcursionsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.ExcursionsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of excursions. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs index 3b662c9a08..988ddea545 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Excursions/Item/ExcursionsItemRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item +{ /// /// Builds and executes requests for operations under \excursions\{id} /// - public class ExcursionsItemRequestBuilder : BaseRequestBuilder + public class ExcursionsItemRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ExcursionsItemRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public ExcursionsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -48,34 +49,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual excursion by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -84,11 +85,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -97,33 +98,33 @@ public async Task HeadAsync(Action /// Updates an existing excursion. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing excursion by its identifier. @@ -151,11 +152,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -170,11 +171,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -189,11 +190,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateExcursionRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateExcursionRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -206,11 +207,11 @@ public RequestInformation ToPatchRequestInformation(UpdateExcursionRequestDocume /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ExcursionsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item.ExcursionsItemRequestBuilder WithUrl(string rawUrl) { - return new ExcursionsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.Item.ExcursionsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual excursion by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/LinksClient.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/LinksClient.cs index 76e71b28a1..383f4d288e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/LinksClient.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/LinksClient.cs @@ -15,34 +15,35 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class LinksClient : BaseRequestBuilder + public class LinksClient : BaseRequestBuilder { /// The accommodations property - public AccommodationsRequestBuilder Accommodations + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.AccommodationsRequestBuilder Accommodations { - get => new AccommodationsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Accommodations.AccommodationsRequestBuilder(PathParameters, RequestAdapter); } /// The excursions property - public ExcursionsRequestBuilder Excursions + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.ExcursionsRequestBuilder Excursions { - get => new ExcursionsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Excursions.ExcursionsRequestBuilder(PathParameters, RequestAdapter); } /// The transports property - public TransportsRequestBuilder Transports + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.TransportsRequestBuilder Transports { - get => new TransportsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.TransportsRequestBuilder(PathParameters, RequestAdapter); } /// The vacations property - public VacationsRequestBuilder Vacations + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.VacationsRequestBuilder Vacations { - get => new VacationsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.VacationsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation.cs deleted file mode 100644 index b165e79004..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Accommodation : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public AccommodationAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public AccommodationAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Accommodation_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Accommodation_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Accommodation CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Accommodation(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Accommodation_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInResponse.cs index 47abf48776..959d688467 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationAttributesInResponse.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationAttributesInResponse : IBackedModel, IParsable + public class AccommodationAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The address property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Address { + public string? Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } #nullable restore #else - public string Address { + public string Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } @@ -27,7 +30,7 @@ public string Address { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationAttributesInResponse() { @@ -36,12 +39,12 @@ public AccommodationAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"address", n => { Address = n.GetStringValue(); } }, + { "address", n => { Address = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs index fa9796fde2..144231b8c3 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationCollectionResponseDocument : IBackedModel, IParsable + public class AccommodationCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class AccommodationCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public AccommodationCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationCollectionResponseDocument() { @@ -78,12 +87,12 @@ public AccommodationCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(AccommodationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(AccommodationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs index fd9cd21163..14343ff0ad 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class AccommodationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public AccommodationCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs index d9b57e5ea0..833f650a2f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationDataInResponse : DataInResponse, IParsable + public class AccommodationDataInResponse : OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AccommodationAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public AccommodationDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new AccommodationDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationDataInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(AccommodationDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs index 1e03befe0b..b278ad09bb 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class AccommodationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationDataInResponse_meta() { @@ -28,12 +30,12 @@ public AccommodationDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs index a0c55d4811..4bd114bc48 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationIdentifier : IBackedModel, IParsable + public class AccommodationIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class AccommodationIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public AccommodationResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationIdentifier() { @@ -41,12 +45,12 @@ public AccommodationIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs index e15bfa39d3..da7dbf3dfa 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationIdentifierResponseDocument : IBackedModel, IParsable + public class AccommodationIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class AccommodationIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public AccommodationIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public AccommodationIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public AccommodationIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(AccommodationIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(AccommodationIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs index ea3b7a99fb..3613eec578 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class AccommodationIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public AccommodationIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs index 12e4bff81d..7911b7576b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationPrimaryResponseDocument : IBackedModel, IParsable + public class AccommodationPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class AccommodationPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Accommodations? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Accommodations Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public AccommodationPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public AccommodationPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Accommodations.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(AccommodationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs index cc25ea3844..c161a1ee33 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class AccommodationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public AccommodationPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationResourceType.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationResourceType.cs index d84e93dddf..86a66179db 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum AccommodationResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs index 6b01c6dcf1..a075426139 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationSecondaryResponseDocument : IBackedModel, IParsable + public class AccommodationSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class AccommodationSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Accommodation? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Accommodation Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public AccommodationSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public AccommodationSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Accommodation.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(AccommodationSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs index 6fe79a2644..5ff9048c4e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AccommodationSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class AccommodationSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AccommodationSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public AccommodationSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AccommodationSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AccommodationSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation_meta.cs deleted file mode 100644 index 64418b90cc..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodation_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Accommodation_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Accommodation_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Accommodation_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Accommodation_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations.cs deleted file mode 100644 index 86fbaecce2..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Accommodations : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public AccommodationAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public AccommodationAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Accommodations_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Accommodations_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Accommodations CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Accommodations(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Accommodations_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations_meta.cs deleted file mode 100644 index 5ecdd1b041..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Accommodations_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Accommodations_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Accommodations_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Accommodations_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Accommodations_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs index 5e3f97b344..c1202c531b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateAccommodationRequest.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateAccommodationRequest : IBackedModel, IParsable + public class AttributesInCreateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The address property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Address { + public string? Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } #nullable restore #else - public string Address { + public string Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } @@ -27,7 +30,7 @@ public string Address { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateAccommodationRequest() { @@ -36,12 +39,12 @@ public AttributesInCreateAccommodationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateAccommodationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"address", n => { Address = n.GetStringValue(); } }, + { "address", n => { Address = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs index 5f928fcc54..a161e2747f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateExcursionRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateExcursionRequest : IBackedModel, IParsable + public class AttributesInCreateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class AttributesInCreateExcursionRequest : IBackedModel, IParsable /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The occursAt property - public DateTimeOffset? OccursAt { + public DateTimeOffset? OccursAt + { get { return BackingStore?.Get("occursAt"); } set { BackingStore?.Set("occursAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateExcursionRequest() { @@ -41,12 +45,12 @@ public AttributesInCreateExcursionRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateExcursionRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateExcursionRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"description", n => { Description = n.GetStringValue(); } }, - {"occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs index e4cb88abb1..7516fee260 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateTransportRequest.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateTransportRequest : IBackedModel, IParsable + public class AttributesInCreateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The durationInMinutes property - public int? DurationInMinutes { + public int? DurationInMinutes + { get { return BackingStore?.Get("durationInMinutes"); } set { BackingStore?.Set("durationInMinutes", value); } } /// The type property - public int? Type { + public int? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateTransportRequest() { @@ -32,12 +35,12 @@ public AttributesInCreateTransportRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateTransportRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateTransportRequest(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, - {"type", n => { Type = n.GetIntValue(); } }, + { "durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, + { "type", n => { Type = n.GetIntValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs index 60e866e372..8451466301 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInCreateVacationRequest.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateVacationRequest : IBackedModel, IParsable + public class AttributesInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The endsAt property - public DateTimeOffset? EndsAt { + public DateTimeOffset? EndsAt + { get { return BackingStore?.Get("endsAt"); } set { BackingStore?.Set("endsAt", value); } } /// The startsAt property - public DateTimeOffset? StartsAt { + public DateTimeOffset? StartsAt + { get { return BackingStore?.Get("startsAt"); } set { BackingStore?.Set("startsAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateVacationRequest() { @@ -32,12 +35,12 @@ public AttributesInCreateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateVacationRequest(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, - {"startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, + { "endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, + { "startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs index 44c0d6a9bb..d8654f6cbf 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateAccommodationRequest.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateAccommodationRequest : IBackedModel, IParsable + public class AttributesInUpdateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The address property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Address { + public string? Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } #nullable restore #else - public string Address { + public string Address + { get { return BackingStore?.Get("address"); } set { BackingStore?.Set("address", value); } } @@ -27,7 +30,7 @@ public string Address { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateAccommodationRequest() { @@ -36,12 +39,12 @@ public AttributesInUpdateAccommodationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateAccommodationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"address", n => { Address = n.GetStringValue(); } }, + { "address", n => { Address = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs index a1181d0448..66dfdbc90d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateExcursionRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateExcursionRequest : IBackedModel, IParsable + public class AttributesInUpdateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class AttributesInUpdateExcursionRequest : IBackedModel, IParsable /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The occursAt property - public DateTimeOffset? OccursAt { + public DateTimeOffset? OccursAt + { get { return BackingStore?.Get("occursAt"); } set { BackingStore?.Set("occursAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateExcursionRequest() { @@ -41,12 +45,12 @@ public AttributesInUpdateExcursionRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateExcursionRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateExcursionRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"description", n => { Description = n.GetStringValue(); } }, - {"occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs index 331cacb486..17af3fce84 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateTransportRequest.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateTransportRequest : IBackedModel, IParsable + public class AttributesInUpdateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The durationInMinutes property - public int? DurationInMinutes { + public int? DurationInMinutes + { get { return BackingStore?.Get("durationInMinutes"); } set { BackingStore?.Set("durationInMinutes", value); } } /// The type property - public int? Type { + public int? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateTransportRequest() { @@ -32,12 +35,12 @@ public AttributesInUpdateTransportRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateTransportRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateTransportRequest(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, - {"type", n => { Type = n.GetIntValue(); } }, + { "durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, + { "type", n => { Type = n.GetIntValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs index eeb62a0f96..aaabcde433 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AttributesInUpdateVacationRequest.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateVacationRequest : IBackedModel, IParsable + public class AttributesInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The endsAt property - public DateTimeOffset? EndsAt { + public DateTimeOffset? EndsAt + { get { return BackingStore?.Get("endsAt"); } set { BackingStore?.Set("endsAt", value); } } /// The startsAt property - public DateTimeOffset? StartsAt { + public DateTimeOffset? StartsAt + { get { return BackingStore?.Get("startsAt"); } set { BackingStore?.Set("startsAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateVacationRequest() { @@ -32,12 +35,12 @@ public AttributesInUpdateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateVacationRequest(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, - {"startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, + { "endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, + { "startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs index e465d5afc2..c3b73f1c61 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateAccommodationRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateAccommodationRequestDocument : IBackedModel, IParsable + public class CreateAccommodationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateAccommodationRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateAccommodationRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateAccommodationRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateAccommodationRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateAccommodationRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateAccommodationRequestDocument() { @@ -36,12 +39,12 @@ public CreateAccommodationRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateAccommodationRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateAccommodationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs index 00ac5e8202..a0d755c97f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateExcursionRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateExcursionRequestDocument : IBackedModel, IParsable + public class CreateExcursionRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateExcursionRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateExcursionRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateExcursionRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateExcursionRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateExcursionRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateExcursionRequestDocument() { @@ -36,12 +39,12 @@ public CreateExcursionRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateExcursionRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateExcursionRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs index 017f73e400..f771a011f3 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateTransportRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateTransportRequestDocument : IBackedModel, IParsable + public class CreateTransportRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateTransportRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateTransportRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateTransportRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateTransportRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateTransportRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateTransportRequestDocument() { @@ -36,12 +39,12 @@ public CreateTransportRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateTransportRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateTransportRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateTransportRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs index 0b71cf93cd..cee2e0ce3d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/CreateVacationRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateVacationRequestDocument : IBackedModel, IParsable + public class CreateVacationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateVacationRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateVacationRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateVacationRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateVacationRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateVacationRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateVacationRequestDocument() { @@ -36,12 +39,12 @@ public CreateVacationRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateVacationRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateVacationRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateVacationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs index 7d381a8a05..9191ca0797 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateAccommodationRequest.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateAccommodationRequest : IBackedModel, IParsable + public class DataInCreateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateAccommodationRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateAccommodationRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateAccommodationRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateAccommodationRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The type property - public AccommodationResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateAccommodationRequest() { @@ -41,12 +45,12 @@ public DataInCreateAccommodationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateAccommodationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateAccommodationRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -67,8 +71,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs index dbbd0a2cd9..d2a8ca3371 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateExcursionRequest.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateExcursionRequest : IBackedModel, IParsable + public class DataInCreateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateExcursionRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateExcursionRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateExcursionRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateExcursionRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The type property - public ExcursionResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateExcursionRequest() { @@ -41,12 +45,12 @@ public DataInCreateExcursionRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateExcursionRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateExcursionRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateExcursionRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -67,8 +71,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs index 039ff252a9..d6aebd7f80 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateTransportRequest.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateTransportRequest : IBackedModel, IParsable + public class DataInCreateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateTransportRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateTransportRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateTransportRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateTransportRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The type property - public TransportResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateTransportRequest() { @@ -41,12 +45,12 @@ public DataInCreateTransportRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateTransportRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateTransportRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateTransportRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateTransportRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -67,8 +71,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs index 75ec3e59c6..8aad02e92f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInCreateVacationRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateVacationRequest : IBackedModel, IParsable + public class DataInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateVacationRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateVacationRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateVacationRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateVacationRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateVacationRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateVacationRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInCreateVacationRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateVacationRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInCreateVacationRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public VacationResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateVacationRequest() { @@ -55,12 +61,12 @@ public DataInCreateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInCreateVacationRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateVacationRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateVacationRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInCreateVacationRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInCreateVacationRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs index 8b53913910..21930562a4 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,19 +55,19 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "accommodations" => new AccommodationDataInResponse(), - "excursions" => new ExcursionDataInResponse(), - "transports" => new TransportDataInResponse(), - "vacations" => new VacationDataInResponse(), - _ => new DataInResponse(), + "accommodations" => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse(), + "excursions" => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse(), + "transports" => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse(), + "vacations" => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse(), }; } /// @@ -73,8 +78,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs index 4f02d6a594..2416c15fb9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateAccommodationRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateAccommodationRequest : IBackedModel, IParsable + public class DataInUpdateAccommodationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateAccommodationRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateAccommodationRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateAccommodationRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateAccommodationRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInUpdateAccommodationRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public AccommodationResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateAccommodationRequest() { @@ -55,12 +61,12 @@ public DataInUpdateAccommodationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateAccommodationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateAccommodationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateAccommodationRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs index 92948752f1..712eb758b8 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateExcursionRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateExcursionRequest : IBackedModel, IParsable + public class DataInUpdateExcursionRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateExcursionRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateExcursionRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateExcursionRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateExcursionRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInUpdateExcursionRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public ExcursionResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateExcursionRequest() { @@ -55,12 +61,12 @@ public DataInUpdateExcursionRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateExcursionRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateExcursionRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateExcursionRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs index abfc6f029c..4d6f4efc8d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateTransportRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateTransportRequest : IBackedModel, IParsable + public class DataInUpdateTransportRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateTransportRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateTransportRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateTransportRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateTransportRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInUpdateTransportRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public TransportResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateTransportRequest() { @@ -55,12 +61,12 @@ public DataInUpdateTransportRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateTransportRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateTransportRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateTransportRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs index a9e9fa0e5b..d6c22ac82b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInUpdateVacationRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateVacationRequest : IBackedModel, IParsable + public class DataInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateVacationRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateVacationRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateVacationRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateVacationRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateVacationRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateVacationRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInUpdateVacationRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateVacationRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInUpdateVacationRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public VacationResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateVacationRequest() { @@ -69,12 +77,12 @@ public DataInUpdateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateVacationRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AttributesInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorLinks.cs index d1db94660f..c78e68764f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs index 5a183d09e3..5429fae01a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs index d547e78ea6..4c706f9590 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs index 131490d848..1d2abd090d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs index 054c7cc83f..a7143635d8 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorSource.cs index 0bd2d243e5..2e324e8b56 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorTopLevelLinks.cs index 685e49da25..b45f451ddd 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInResponse.cs index 95642dd39b..bbfc612145 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionAttributesInResponse : IBackedModel, IParsable + public class ExcursionAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class ExcursionAttributesInResponse : IBackedModel, IParsable /// The description property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Description { + public string? Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #nullable restore #else - public string Description { + public string Description + { get { return BackingStore?.Get("description"); } set { BackingStore?.Set("description", value); } } #endif /// The occursAt property - public DateTimeOffset? OccursAt { + public DateTimeOffset? OccursAt + { get { return BackingStore?.Get("occursAt"); } set { BackingStore?.Set("occursAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionAttributesInResponse() { @@ -41,12 +45,12 @@ public ExcursionAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"description", n => { Description = n.GetStringValue(); } }, - {"occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, + { "description", n => { Description = n.GetStringValue(); } }, + { "occursAt", n => { OccursAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs index 2eb66f01c9..545262acc8 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionCollectionResponseDocument : IBackedModel, IParsable + public class ExcursionCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ExcursionCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ExcursionCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionCollectionResponseDocument() { @@ -78,12 +87,12 @@ public ExcursionCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ExcursionDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ExcursionCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs index 026fa03594..c959512ea1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ExcursionCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public ExcursionCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs index 07b2df9225..4bff032c91 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionDataInResponse : DataInResponse, IParsable + public class ExcursionDataInResponse : OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public ExcursionAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ExcursionDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new ExcursionDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionDataInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(ExcursionAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ExcursionDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs index 8882c6873a..9cf584afbb 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ExcursionDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionDataInResponse_meta() { @@ -28,12 +30,12 @@ public ExcursionDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs index aeb0ad2c97..62cfd7843b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionIdentifier : IBackedModel, IParsable + public class ExcursionIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class ExcursionIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public ExcursionResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionIdentifier() { @@ -41,12 +45,12 @@ public ExcursionIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs index ee3f67640f..606a0065b0 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class ExcursionIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ExcursionIdentifierCollectionResponseDocument : IBackedModel, IPars /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ExcursionIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public ExcursionIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionIdentifierCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ExcursionIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs index d16d0258d4..a85f701878 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ExcursionIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public ExcursionIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs index b55d92163d..76b770a86f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionPrimaryResponseDocument : IBackedModel, IParsable + public class ExcursionPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ExcursionPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Excursions? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Excursions Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ExcursionPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ExcursionPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public ExcursionPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Excursions.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ExcursionPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs index cf3b1ac8dd..e87c5291f4 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ExcursionPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ExcursionPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ExcursionPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public ExcursionPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ExcursionPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ExcursionPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionResourceType.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionResourceType.cs index 3000b6a3c0..42f100a3e1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum ExcursionResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions.cs deleted file mode 100644 index eb500d60a8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Excursions : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ExcursionAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public ExcursionAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Excursions_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Excursions_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Excursions CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Excursions(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(ExcursionAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Excursions_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions_meta.cs deleted file mode 100644 index 924e16f7f3..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Excursions_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Excursions_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Excursions_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Excursions_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Excursions_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs index aea70fa7d9..704015e162 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneTransportInRequest : IBackedModel, IParsable + public class NullableToOneTransportInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class NullableToOneTransportInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TransportIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneTransportInRequest() { @@ -36,12 +39,12 @@ public NullableToOneTransportInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneTransportInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneTransportInRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs index d998e95dbf..75f0d7cd34 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneTransportInResponse : IBackedModel, IParsable + public class NullableToOneTransportInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableToOneTransportInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TransportIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneTransportInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableToOneTransportInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneTransportInResponse() { @@ -64,12 +71,12 @@ public NullableToOneTransportInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneTransportInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneTransportInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TransportIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableToOneTransportInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs index ddefe9b11a..4a0aabf4dc 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneTransportInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableToOneTransportInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneTransportInResponse_meta() { @@ -28,12 +30,12 @@ public NullableToOneTransportInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneTransportInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneTransportInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs index cd7f5472bd..6c35132521 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableTransportIdentifierResponseDocument : IBackedModel, IParsable + public class NullableTransportIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableTransportIdentifierResponseDocument : IBackedModel, IParsab /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public TransportIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableTransportIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableTransportIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableTransportIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public NullableTransportIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableTransportIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableTransportIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(TransportIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableTransportIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs index 1c6e904cd3..bf9b788653 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableTransportIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableTransportIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableTransportIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableTransportIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableTransportIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableTransportIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs index acbe11fa50..040ba264ae 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableTransportSecondaryResponseDocument : IBackedModel, IParsable + public class NullableTransportSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NullableTransportSecondaryResponseDocument : IBackedModel, IParsabl /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Transport? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Transport Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableTransportSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableTransportSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableTransportSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public NullableTransportSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableTransportSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableTransportSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Transport.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableTransportSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs index 450b9b07c7..cfefb685a5 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableTransportSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableTransportSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableTransportSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableTransportSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableTransportSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableTransportSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipLinks.cs index ef3894035b..046a2c2c05 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs index 28053857b9..4c5e7cfcc1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInCreateVacationRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateVacationRequest : IBackedModel, IParsable + public class RelationshipsInCreateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The accommodation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneAccommodationInRequest? Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest? Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #nullable restore #else - public ToOneAccommodationInRequest Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #endif @@ -29,33 +32,37 @@ public ToOneAccommodationInRequest Accommodation { /// The excursions property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyExcursionInRequest? Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest? Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #nullable restore #else - public ToManyExcursionInRequest Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #endif /// The transport property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneTransportInRequest? Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest? Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #nullable restore #else - public NullableToOneTransportInRequest Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateVacationRequest() { @@ -64,12 +71,12 @@ public RelationshipsInCreateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInCreateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInCreateVacationRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"accommodation", n => { Accommodation = n.GetObjectValue(ToOneAccommodationInRequest.CreateFromDiscriminatorValue); } }, - {"excursions", n => { Excursions = n.GetObjectValue(ToManyExcursionInRequest.CreateFromDiscriminatorValue); } }, - {"transport", n => { Transport = n.GetObjectValue(NullableToOneTransportInRequest.CreateFromDiscriminatorValue); } }, + { "accommodation", n => { Accommodation = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest.CreateFromDiscriminatorValue); } }, + { "excursions", n => { Excursions = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest.CreateFromDiscriminatorValue); } }, + { "transport", n => { Transport = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("accommodation", Accommodation); - writer.WriteObjectValue("excursions", Excursions); - writer.WriteObjectValue("transport", Transport); + writer.WriteObjectValue("accommodation", Accommodation); + writer.WriteObjectValue("excursions", Excursions); + writer.WriteObjectValue("transport", Transport); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs index 54e755297c..13a23e3ea1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/RelationshipsInUpdateVacationRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateVacationRequest : IBackedModel, IParsable + public class RelationshipsInUpdateVacationRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The accommodation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneAccommodationInRequest? Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest? Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #nullable restore #else - public ToOneAccommodationInRequest Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #endif @@ -29,33 +32,37 @@ public ToOneAccommodationInRequest Accommodation { /// The excursions property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyExcursionInRequest? Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest? Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #nullable restore #else - public ToManyExcursionInRequest Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #endif /// The transport property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneTransportInRequest? Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest? Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #nullable restore #else - public NullableToOneTransportInRequest Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateVacationRequest() { @@ -64,12 +71,12 @@ public RelationshipsInUpdateVacationRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInUpdateVacationRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateVacationRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipsInUpdateVacationRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"accommodation", n => { Accommodation = n.GetObjectValue(ToOneAccommodationInRequest.CreateFromDiscriminatorValue); } }, - {"excursions", n => { Excursions = n.GetObjectValue(ToManyExcursionInRequest.CreateFromDiscriminatorValue); } }, - {"transport", n => { Transport = n.GetObjectValue(NullableToOneTransportInRequest.CreateFromDiscriminatorValue); } }, + { "accommodation", n => { Accommodation = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest.CreateFromDiscriminatorValue); } }, + { "excursions", n => { Excursions = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest.CreateFromDiscriminatorValue); } }, + { "transport", n => { Transport = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("accommodation", Accommodation); - writer.WriteObjectValue("excursions", Excursions); - writer.WriteObjectValue("transport", Transport); + writer.WriteObjectValue("accommodation", Accommodation); + writer.WriteObjectValue("excursions", Excursions); + writer.WriteObjectValue("transport", Transport); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs index f8507bd201..abf68fa531 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,19 +96,21 @@ public string Prev { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceCollectionTopLevelLinks() { @@ -106,12 +119,12 @@ public ResourceCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -121,12 +134,12 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs index f37961077d..1779f645de 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,13 +96,15 @@ public string Prev { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -99,19 +112,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierCollectionTopLevelLinks() { @@ -120,12 +135,12 @@ public ResourceIdentifierCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -135,13 +150,13 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs index 2678173991..00c97664b4 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -43,19 +48,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierTopLevelLinks() { @@ -64,12 +71,12 @@ public ResourceIdentifierTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceLinks.cs index a1cb82c48b..3f1f890e11 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceTopLevelLinks.cs index 6698f14925..715a52fc43 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs index 66b8ab0f0b..47f434e06d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyExcursionInRequest : IBackedModel, IParsable + public class ToManyExcursionInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyExcursionInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyExcursionInRequest() { @@ -36,12 +39,12 @@ public ToManyExcursionInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyExcursionInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyExcursionInRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs index a96241f817..b594cb52f3 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyExcursionInResponse : IBackedModel, IParsable + public class ToManyExcursionInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyExcursionInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyExcursionInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyExcursionInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyExcursionInResponse() { @@ -64,12 +71,12 @@ public ToManyExcursionInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyExcursionInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyExcursionInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyExcursionInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs index 62ca584ab8..8b2569cb30 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyExcursionInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyExcursionInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyExcursionInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyExcursionInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyExcursionInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyExcursionInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs index c5655a9816..8323ed8d0e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneAccommodationInRequest : IBackedModel, IParsable + public class ToOneAccommodationInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToOneAccommodationInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public AccommodationIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneAccommodationInRequest() { @@ -36,12 +39,12 @@ public ToOneAccommodationInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneAccommodationInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneAccommodationInRequest(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs index eaa11ac1c0..ec9d8e04d0 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneAccommodationInResponse : IBackedModel, IParsable + public class ToOneAccommodationInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToOneAccommodationInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AccommodationIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public AccommodationIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneAccommodationInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToOneAccommodationInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneAccommodationInResponse() { @@ -64,12 +71,12 @@ public ToOneAccommodationInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneAccommodationInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneAccommodationInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(AccommodationIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToOneAccommodationInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs index 0e5b57782e..5e8a0eebdf 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneAccommodationInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToOneAccommodationInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneAccommodationInResponse_meta() { @@ -28,12 +30,12 @@ public ToOneAccommodationInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneAccommodationInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneAccommodationInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport.cs deleted file mode 100644 index 290ea175cc..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Transport : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TransportAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public TransportAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Transport_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Transport_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Transport CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Transport(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Transport_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInResponse.cs index 56bedee7fc..7e443c6565 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportAttributesInResponse.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportAttributesInResponse : IBackedModel, IParsable + public class TransportAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The durationInMinutes property - public int? DurationInMinutes { + public int? DurationInMinutes + { get { return BackingStore?.Get("durationInMinutes"); } set { BackingStore?.Set("durationInMinutes", value); } } /// The type property - public int? Type { + public int? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportAttributesInResponse() { @@ -32,12 +35,12 @@ public TransportAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, - {"type", n => { Type = n.GetIntValue(); } }, + { "durationInMinutes", n => { DurationInMinutes = n.GetIntValue(); } }, + { "type", n => { Type = n.GetIntValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs index 8e33465496..289d08d652 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportCollectionResponseDocument : IBackedModel, IParsable + public class TransportCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TransportCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TransportCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportCollectionResponseDocument() { @@ -78,12 +87,12 @@ public TransportCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(TransportDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TransportCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs index 01fc2fedae..268b4c9c01 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TransportCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public TransportCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs index d36fa82207..29569bad4e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportDataInResponse : DataInResponse, IParsable + public class TransportDataInResponse : OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public TransportAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TransportDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new TransportDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportDataInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TransportDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs index 267799f098..7d4bffc871 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TransportDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportDataInResponse_meta() { @@ -28,12 +30,12 @@ public TransportDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs index d001134d1e..35af6e5a60 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportIdentifier : IBackedModel, IParsable + public class TransportIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class TransportIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public TransportResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportIdentifier() { @@ -41,12 +45,12 @@ public TransportIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs index 3764bdb333..5c477168d7 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportPrimaryResponseDocument : IBackedModel, IParsable + public class TransportPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class TransportPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Transports? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Transports Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public TransportPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public TransportPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public TransportPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Transports.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(TransportPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs index ba975db0b4..a16fad449d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class TransportPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class TransportPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public TransportPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public TransportPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static TransportPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new TransportPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportResourceType.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportResourceType.cs index 76da4b7d8b..fb73aacbd6 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum TransportResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport_meta.cs deleted file mode 100644 index 03f19f2b90..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transport_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Transport_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Transport_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Transport_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Transport_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports.cs deleted file mode 100644 index c31c5f1b04..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Transports : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public TransportAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public TransportAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Transports_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Transports_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Transports CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Transports(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Transports_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports_meta.cs deleted file mode 100644 index a8425f08c3..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Transports_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Transports_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Transports_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Transports_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Transports_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs index 4d34a5c4bb..b8beb2469f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateAccommodationRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateAccommodationRequestDocument : IBackedModel, IParsable + public class UpdateAccommodationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateAccommodationRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateAccommodationRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateAccommodationRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateAccommodationRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateAccommodationRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateAccommodationRequestDocument() { @@ -36,12 +39,12 @@ public UpdateAccommodationRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateAccommodationRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateAccommodationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateAccommodationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs index 5ff5750353..58e9beb513 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateExcursionRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateExcursionRequestDocument : IBackedModel, IParsable + public class UpdateExcursionRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateExcursionRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateExcursionRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateExcursionRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateExcursionRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateExcursionRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateExcursionRequestDocument() { @@ -36,12 +39,12 @@ public UpdateExcursionRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateExcursionRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateExcursionRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateExcursionRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs index de147e637d..3a55537685 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateTransportRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateTransportRequestDocument : IBackedModel, IParsable + public class UpdateTransportRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateTransportRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateTransportRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateTransportRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateTransportRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateTransportRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateTransportRequestDocument() { @@ -36,12 +39,12 @@ public UpdateTransportRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateTransportRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateTransportRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs index d55c3b624c..c4d3f6459f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/UpdateVacationRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateVacationRequestDocument : IBackedModel, IParsable + public class UpdateVacationRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateVacationRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateVacationRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateVacationRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateVacationRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateVacationRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateVacationRequestDocument() { @@ -36,12 +39,12 @@ public UpdateVacationRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateVacationRequestDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInUpdateVacationRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInResponse.cs index 795c695eb2..e49351d3e9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationAttributesInResponse.cs @@ -5,25 +5,28 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationAttributesInResponse : IBackedModel, IParsable + public class VacationAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The endsAt property - public DateTimeOffset? EndsAt { + public DateTimeOffset? EndsAt + { get { return BackingStore?.Get("endsAt"); } set { BackingStore?.Set("endsAt", value); } } /// The startsAt property - public DateTimeOffset? StartsAt { + public DateTimeOffset? StartsAt + { get { return BackingStore?.Get("startsAt"); } set { BackingStore?.Set("startsAt", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationAttributesInResponse() { @@ -32,12 +35,12 @@ public VacationAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse(); } /// /// The deserialization information for the current model @@ -47,8 +50,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, - {"startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, + { "endsAt", n => { EndsAt = n.GetDateTimeOffsetValue(); } }, + { "startsAt", n => { StartsAt = n.GetDateTimeOffsetValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs index 6766fc68f0..e48ea64271 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationCollectionResponseDocument : IBackedModel, IParsable + public class VacationCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class VacationCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public VacationCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationCollectionResponseDocument() { @@ -78,12 +87,12 @@ public VacationCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(VacationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(VacationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs index ceaf90386d..95a045f82d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class VacationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public VacationCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs index caf776a828..ef4be7843a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationDataInResponse : DataInResponse, IParsable + public class VacationDataInResponse : OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public VacationAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public VacationDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public VacationRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new VacationDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationDataInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(VacationAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(VacationDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(VacationRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs index a5d530d5aa..3e9c0530fb 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class VacationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationDataInResponse_meta() { @@ -28,12 +30,12 @@ public VacationDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs index 5dbe974c86..175df91a4e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationPrimaryResponseDocument : IBackedModel, IParsable + public class VacationPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class VacationPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Vacations? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Vacations Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VacationPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public VacationPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public VacationPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Vacations.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(VacationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs index 161252686c..b460aa2aa7 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class VacationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public VacationPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInResponse.cs index b97673ec77..5acf100b59 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class VacationRelationshipsInResponse : IBackedModel, IParsable + public class VacationRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The accommodation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneAccommodationInResponse? Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse? Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #nullable restore #else - public ToOneAccommodationInResponse Accommodation { - get { return BackingStore?.Get("accommodation"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse Accommodation + { + get { return BackingStore?.Get("accommodation"); } set { BackingStore?.Set("accommodation", value); } } #endif @@ -29,33 +32,37 @@ public ToOneAccommodationInResponse Accommodation { /// The excursions property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyExcursionInResponse? Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse? Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #nullable restore #else - public ToManyExcursionInResponse Excursions { - get { return BackingStore?.Get("excursions"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse Excursions + { + get { return BackingStore?.Get("excursions"); } set { BackingStore?.Set("excursions", value); } } #endif /// The transport property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneTransportInResponse? Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse? Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #nullable restore #else - public NullableToOneTransportInResponse Transport { - get { return BackingStore?.Get("transport"); } + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse Transport + { + get { return BackingStore?.Get("transport"); } set { BackingStore?.Set("transport", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public VacationRelationshipsInResponse() { @@ -64,12 +71,12 @@ public VacationRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static VacationRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VacationRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"accommodation", n => { Accommodation = n.GetObjectValue(ToOneAccommodationInResponse.CreateFromDiscriminatorValue); } }, - {"excursions", n => { Excursions = n.GetObjectValue(ToManyExcursionInResponse.CreateFromDiscriminatorValue); } }, - {"transport", n => { Transport = n.GetObjectValue(NullableToOneTransportInResponse.CreateFromDiscriminatorValue); } }, + { "accommodation", n => { Accommodation = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse.CreateFromDiscriminatorValue); } }, + { "excursions", n => { Excursions = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse.CreateFromDiscriminatorValue); } }, + { "transport", n => { Transport = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("accommodation", Accommodation); - writer.WriteObjectValue("excursions", Excursions); - writer.WriteObjectValue("transport", Transport); + writer.WriteObjectValue("accommodation", Accommodation); + writer.WriteObjectValue("excursions", Excursions); + writer.WriteObjectValue("transport", Transport); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationResourceType.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationResourceType.cs index c610203b3c..20e450c43b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum VacationResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations.cs deleted file mode 100644 index 41af53bcf8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Vacations : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public VacationAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public VacationAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Vacations_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Vacations_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public VacationRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public VacationRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Vacations CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Vacations(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(VacationAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Vacations_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(VacationRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations_meta.cs deleted file mode 100644 index d0ca7274e8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Vacations_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Vacations_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Vacations_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Vacations_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Vacations_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs index c72b293622..971d82e0a7 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/Item/TransportsItemRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item +{ /// /// Builds and executes requests for operations under \transports\{id} /// - public class TransportsItemRequestBuilder : BaseRequestBuilder + public class TransportsItemRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TransportsItemRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public TransportsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -48,34 +49,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual transport by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -84,11 +85,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -97,33 +98,33 @@ public async Task HeadAsync(Action /// Updates an existing transport. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing transport by its identifier. @@ -151,11 +152,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -170,11 +171,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -189,11 +190,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateTransportRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateTransportRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateTransportRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -206,11 +207,11 @@ public RequestInformation ToPatchRequestInformation(UpdateTransportRequestDocume /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TransportsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item.TransportsItemRequestBuilder WithUrl(string rawUrl) { - return new TransportsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item.TransportsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual transport by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs index af79b5ec0a..95c4facafd 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Transports/TransportsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports +{ /// /// Builds and executes requests for operations under \transports /// - public class TransportsRequestBuilder : BaseRequestBuilder + public class TransportsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.Links.GeneratedCode.transports.item collection /// The identifier of the transport to retrieve. - /// A - public TransportsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item.TransportsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new TransportsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.Item.TransportsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public TransportsRequestBuilder(Dictionary pathParameters, IRequ { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public TransportsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves a collection of transports. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TransportCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new transport. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of transports. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateTransportReq /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateTransportRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateTransportRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateTransportRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateTransportRequestDocumen /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TransportsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.TransportsRequestBuilder WithUrl(string rawUrl) { - return new TransportsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Transports.TransportsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of transports. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Accommodation/AccommodationRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Accommodation/AccommodationRequestBuilder.cs index eda27b10cb..76d6bf9523 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Accommodation/AccommodationRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Accommodation/AccommodationRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation +{ /// /// Builds and executes requests for operations under \vacations\{id}\accommodation /// - public class AccommodationRequestBuilder : BaseRequestBuilder + public class AccommodationRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AccommodationRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AccommodationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter /// /// Retrieves the related accommodation of an individual vacation's accommodation relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AccommodationRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation.AccommodationRequestBuilder WithUrl(string rawUrl) { - return new AccommodationRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation.AccommodationRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related accommodation of an individual vacation's accommodation relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Excursions/ExcursionsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Excursions/ExcursionsRequestBuilder.cs index f3d1894f05..70c5bed52b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Excursions/ExcursionsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Excursions/ExcursionsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions +{ /// /// Builds and executes requests for operations under \vacations\{id}\excursions /// - public class ExcursionsRequestBuilder : BaseRequestBuilder + public class ExcursionsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ExcursionsRequestBuilder(Dictionary pathParameters, IRequ { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public ExcursionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves the related excursions of an individual vacation's excursions relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ExcursionsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions.ExcursionsRequestBuilder WithUrl(string rawUrl) { - return new ExcursionsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions.ExcursionsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related excursions of an individual vacation's excursions relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Accommodation/AccommodationRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Accommodation/AccommodationRequestBuilder.cs index 632663c578..d3f1ad9671 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Accommodation/AccommodationRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Accommodation/AccommodationRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation +{ /// /// Builds and executes requests for operations under \vacations\{id}\relationships\accommodation /// - public class AccommodationRequestBuilder : BaseRequestBuilder + public class AccommodationRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AccommodationRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AccommodationRequestBuilder(string rawUrl, IRequestAdapter requestAdapter /// /// Retrieves the related accommodation identity of an individual vacation's accommodation relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, AccommodationIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToOneAccommodationInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToOneAccommodationInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(ToOneAccommodationInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToOneAccommodationInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToOneAccommodationInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(ToOneAccommodationInRequest /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AccommodationRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation.AccommodationRequestBuilder WithUrl(string rawUrl) { - return new AccommodationRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation.AccommodationRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related accommodation identity of an individual vacation's accommodation relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Excursions/ExcursionsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Excursions/ExcursionsRequestBuilder.cs index 2dadc3e19a..0fd56dd62f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Excursions/ExcursionsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Excursions/ExcursionsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions +{ /// /// Builds and executes requests for operations under \vacations\{id}\relationships\excursions /// - public class ExcursionsRequestBuilder : BaseRequestBuilder + public class ExcursionsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ExcursionsRequestBuilder(Dictionary pathParameters, IRequ { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public ExcursionsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related excursion identities of an individual vacation's excursions relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ExcursionIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Action /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyExcursionInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyExcursionInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyExcursionInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyExcursionInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyExcursionInRequest bo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyExcursionInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyExcursionInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyExcursionInRequest bod /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyExcursionInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyExcursionInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyExcursionInRequest body /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ExcursionsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions.ExcursionsRequestBuilder WithUrl(string rawUrl) { - return new ExcursionsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions.ExcursionsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related excursion identities of an individual vacation's excursions relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/RelationshipsRequestBuilder.cs index bfd7cb4576..3e178db76e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships +{ /// /// Builds and executes requests for operations under \vacations\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The accommodation property - public AccommodationRequestBuilder Accommodation + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation.AccommodationRequestBuilder Accommodation { - get => new AccommodationRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Accommodation.AccommodationRequestBuilder(PathParameters, RequestAdapter); } /// The excursions property - public ExcursionsRequestBuilder Excursions + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions.ExcursionsRequestBuilder Excursions { - get => new ExcursionsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Excursions.ExcursionsRequestBuilder(PathParameters, RequestAdapter); } /// The transport property - public TransportRequestBuilder Transport + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport.TransportRequestBuilder Transport { - get => new TransportRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport.TransportRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Transport/TransportRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Transport/TransportRequestBuilder.cs index d74655c392..d7069eea6f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Transport/TransportRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Relationships/Transport/TransportRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport +{ /// /// Builds and executes requests for operations under \vacations\{id}\relationships\transport /// - public class TransportRequestBuilder : BaseRequestBuilder + public class TransportRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TransportRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public TransportRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves the related transport identity of an individual vacation's transport relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableTransportIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NullableToOneTransportInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NullableToOneTransportInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(NullableToOneTransportInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NullableToOneTransportInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NullableToOneTransportInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(NullableToOneTransportInRequ /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TransportRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport.TransportRequestBuilder WithUrl(string rawUrl) { - return new TransportRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.Transport.TransportRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related transport identity of an individual vacation's transport relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Transport/TransportRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Transport/TransportRequestBuilder.cs index da61ae4ed3..a72b6882d2 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Transport/TransportRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/Transport/TransportRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport +{ /// /// Builds and executes requests for operations under \vacations\{id}\transport /// - public class TransportRequestBuilder : BaseRequestBuilder + public class TransportRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public TransportRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public TransportRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves the related transport of an individual vacation's transport relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableTransportSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public TransportRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport.TransportRequestBuilder WithUrl(string rawUrl) { - return new TransportRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport.TransportRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related transport of an individual vacation's transport relationship. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs index ff7fc9165f..892d29bbf9 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/Item/VacationsItemRequestBuilder.cs @@ -12,34 +12,35 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item +{ /// /// Builds and executes requests for operations under \vacations\{id} /// - public class VacationsItemRequestBuilder : BaseRequestBuilder + public class VacationsItemRequestBuilder : BaseRequestBuilder { /// The accommodation property - public AccommodationRequestBuilder Accommodation + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation.AccommodationRequestBuilder Accommodation { - get => new AccommodationRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Accommodation.AccommodationRequestBuilder(PathParameters, RequestAdapter); } /// The excursions property - public ExcursionsRequestBuilder Excursions + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions.ExcursionsRequestBuilder Excursions { - get => new ExcursionsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Excursions.ExcursionsRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// The transport property - public TransportRequestBuilder Transport + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport.TransportRequestBuilder Transport { - get => new TransportRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.Transport.TransportRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public VacationsItemRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -59,7 +60,7 @@ public VacationsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -72,34 +73,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual vacation by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -108,11 +109,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -121,33 +122,33 @@ public async Task HeadAsync(Action /// Updates an existing vacation. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing vacation by its identifier. @@ -175,11 +176,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -194,11 +195,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -213,11 +214,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateVacationRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateVacationRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.UpdateVacationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -230,11 +231,11 @@ public RequestInformation ToPatchRequestInformation(UpdateVacationRequestDocumen /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VacationsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.VacationsItemRequestBuilder WithUrl(string rawUrl) { - return new VacationsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.VacationsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual vacation by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs index 096c3da80d..e3450f481c 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Vacations/VacationsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations { +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations +{ /// /// Builds and executes requests for operations under \vacations /// - public class VacationsRequestBuilder : BaseRequestBuilder + public class VacationsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.Links.GeneratedCode.vacations.item collection /// The identifier of the vacation to retrieve. - /// A - public VacationsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.VacationsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new VacationsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.Item.VacationsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public VacationsRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public VacationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Retrieves a collection of vacations. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, VacationCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new vacation. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of vacations. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateVacationReque /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateVacationRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateVacationRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.CreateVacationRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateVacationRequestDocument /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VacationsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.VacationsRequestBuilder WithUrl(string rawUrl) { - return new VacationsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Vacations.VacationsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of vacations. diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/ModelStateValidationClient.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/ModelStateValidationClient.cs index bf9e33ae22..cc1509281f 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/ModelStateValidationClient.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/ModelStateValidationClient.cs @@ -12,19 +12,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class ModelStateValidationClient : BaseRequestBuilder + public class ModelStateValidationClient : BaseRequestBuilder { /// The socialMediaAccounts property - public SocialMediaAccountsRequestBuilder SocialMediaAccounts + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.SocialMediaAccountsRequestBuilder SocialMediaAccounts { - get => new SocialMediaAccountsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.SocialMediaAccountsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs index 7c5fa04bd3..187ce344ac 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInCreateSocialMediaAccountRequest.cs @@ -6,31 +6,36 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateSocialMediaAccountRequest : IBackedModel, IParsable + public class AttributesInCreateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The age property - public double? Age { + public double? Age + { get { return BackingStore?.Get("age"); } set { BackingStore?.Set("age", value); } } /// The alternativeId property - public Guid? AlternativeId { + public Guid? AlternativeId + { get { return BackingStore?.Get("alternativeId"); } set { BackingStore?.Set("alternativeId", value); } } /// The backgroundPicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? BackgroundPicture { + public string? BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } #nullable restore #else - public string BackgroundPicture { + public string BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } @@ -40,13 +45,15 @@ public string BackgroundPicture { /// The countryCode property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CountryCode { + public string? CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } #nullable restore #else - public string CountryCode { + public string CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } @@ -54,13 +61,15 @@ public string CountryCode { /// The creditCard property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CreditCard { + public string? CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } #nullable restore #else - public string CreditCard { + public string CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } @@ -68,13 +77,15 @@ public string CreditCard { /// The email property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Email { + public string? Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } #nullable restore #else - public string Email { + public string Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } @@ -82,13 +93,15 @@ public string Email { /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -96,13 +109,15 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } @@ -110,13 +125,15 @@ public string LastName { /// The nextRevalidation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? NextRevalidation { + public string? NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } #nullable restore #else - public string NextRevalidation { + public string NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } @@ -124,13 +141,15 @@ public string NextRevalidation { /// The password property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Password { + public string? Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } #nullable restore #else - public string Password { + public string Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } @@ -138,13 +157,15 @@ public string Password { /// The phone property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Phone { + public string? Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } #nullable restore #else - public string Phone { + public string Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } @@ -152,13 +173,15 @@ public string Phone { /// The planet property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Planet { + public string? Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } #nullable restore #else - public string Planet { + public string Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } @@ -166,13 +189,15 @@ public string Planet { /// The profilePicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? ProfilePicture { + public string? ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } #nullable restore #else - public string ProfilePicture { + public string ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } @@ -180,13 +205,15 @@ public string ProfilePicture { /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Tags { + public List? Tags + { get { return BackingStore?.Get?>("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public List Tags { + public List Tags + { get { return BackingStore?.Get>("tags"); } set { BackingStore?.Set("tags", value); } } @@ -194,34 +221,39 @@ public List Tags { /// The userName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? UserName { + public string? UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #nullable restore #else - public string UserName { + public string UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #endif /// The validatedAt property - public DateTimeOffset? ValidatedAt { + public DateTimeOffset? ValidatedAt + { get { return BackingStore?.Get("validatedAt"); } set { BackingStore?.Set("validatedAt", value); } } /// The validatedAtDate property - public Date? ValidatedAtDate { + public Date? ValidatedAtDate + { get { return BackingStore?.Get("validatedAtDate"); } set { BackingStore?.Set("validatedAtDate", value); } } /// The validatedAtTime property - public Time? ValidatedAtTime { + public Time? ValidatedAtTime + { get { return BackingStore?.Get("validatedAtTime"); } set { BackingStore?.Set("validatedAtTime", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateSocialMediaAccountRequest() { @@ -230,12 +262,12 @@ public AttributesInCreateSocialMediaAccountRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateSocialMediaAccountRequest(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInCreateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -245,24 +277,24 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"age", n => { Age = n.GetDoubleValue(); } }, - {"alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, - {"backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, - {"countryCode", n => { CountryCode = n.GetStringValue(); } }, - {"creditCard", n => { CreditCard = n.GetStringValue(); } }, - {"email", n => { Email = n.GetStringValue(); } }, - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, - {"nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, - {"password", n => { Password = n.GetStringValue(); } }, - {"phone", n => { Phone = n.GetStringValue(); } }, - {"planet", n => { Planet = n.GetStringValue(); } }, - {"profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, - {"tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, - {"userName", n => { UserName = n.GetStringValue(); } }, - {"validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, - {"validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, - {"validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, + { "age", n => { Age = n.GetDoubleValue(); } }, + { "alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, + { "backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, + { "countryCode", n => { CountryCode = n.GetStringValue(); } }, + { "creditCard", n => { CreditCard = n.GetStringValue(); } }, + { "email", n => { Email = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, + { "nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "phone", n => { Phone = n.GetStringValue(); } }, + { "planet", n => { Planet = n.GetStringValue(); } }, + { "profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "userName", n => { UserName = n.GetStringValue(); } }, + { "validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, + { "validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, + { "validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs index 4dac21ff93..7a2c0b0add 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/AttributesInUpdateSocialMediaAccountRequest.cs @@ -6,31 +6,36 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateSocialMediaAccountRequest : IBackedModel, IParsable + public class AttributesInUpdateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The age property - public double? Age { + public double? Age + { get { return BackingStore?.Get("age"); } set { BackingStore?.Set("age", value); } } /// The alternativeId property - public Guid? AlternativeId { + public Guid? AlternativeId + { get { return BackingStore?.Get("alternativeId"); } set { BackingStore?.Set("alternativeId", value); } } /// The backgroundPicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? BackgroundPicture { + public string? BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } #nullable restore #else - public string BackgroundPicture { + public string BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } @@ -40,13 +45,15 @@ public string BackgroundPicture { /// The countryCode property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CountryCode { + public string? CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } #nullable restore #else - public string CountryCode { + public string CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } @@ -54,13 +61,15 @@ public string CountryCode { /// The creditCard property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CreditCard { + public string? CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } #nullable restore #else - public string CreditCard { + public string CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } @@ -68,13 +77,15 @@ public string CreditCard { /// The email property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Email { + public string? Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } #nullable restore #else - public string Email { + public string Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } @@ -82,13 +93,15 @@ public string Email { /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -96,13 +109,15 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } @@ -110,13 +125,15 @@ public string LastName { /// The nextRevalidation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? NextRevalidation { + public string? NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } #nullable restore #else - public string NextRevalidation { + public string NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } @@ -124,13 +141,15 @@ public string NextRevalidation { /// The password property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Password { + public string? Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } #nullable restore #else - public string Password { + public string Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } @@ -138,13 +157,15 @@ public string Password { /// The phone property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Phone { + public string? Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } #nullable restore #else - public string Phone { + public string Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } @@ -152,13 +173,15 @@ public string Phone { /// The planet property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Planet { + public string? Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } #nullable restore #else - public string Planet { + public string Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } @@ -166,13 +189,15 @@ public string Planet { /// The profilePicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? ProfilePicture { + public string? ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } #nullable restore #else - public string ProfilePicture { + public string ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } @@ -180,13 +205,15 @@ public string ProfilePicture { /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Tags { + public List? Tags + { get { return BackingStore?.Get?>("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public List Tags { + public List Tags + { get { return BackingStore?.Get>("tags"); } set { BackingStore?.Set("tags", value); } } @@ -194,34 +221,39 @@ public List Tags { /// The userName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? UserName { + public string? UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #nullable restore #else - public string UserName { + public string UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #endif /// The validatedAt property - public DateTimeOffset? ValidatedAt { + public DateTimeOffset? ValidatedAt + { get { return BackingStore?.Get("validatedAt"); } set { BackingStore?.Set("validatedAt", value); } } /// The validatedAtDate property - public Date? ValidatedAtDate { + public Date? ValidatedAtDate + { get { return BackingStore?.Get("validatedAtDate"); } set { BackingStore?.Set("validatedAtDate", value); } } /// The validatedAtTime property - public Time? ValidatedAtTime { + public Time? ValidatedAtTime + { get { return BackingStore?.Get("validatedAtTime"); } set { BackingStore?.Set("validatedAtTime", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateSocialMediaAccountRequest() { @@ -230,12 +262,12 @@ public AttributesInUpdateSocialMediaAccountRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateSocialMediaAccountRequest(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInUpdateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -245,24 +277,24 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"age", n => { Age = n.GetDoubleValue(); } }, - {"alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, - {"backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, - {"countryCode", n => { CountryCode = n.GetStringValue(); } }, - {"creditCard", n => { CreditCard = n.GetStringValue(); } }, - {"email", n => { Email = n.GetStringValue(); } }, - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, - {"nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, - {"password", n => { Password = n.GetStringValue(); } }, - {"phone", n => { Phone = n.GetStringValue(); } }, - {"planet", n => { Planet = n.GetStringValue(); } }, - {"profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, - {"tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, - {"userName", n => { UserName = n.GetStringValue(); } }, - {"validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, - {"validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, - {"validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, + { "age", n => { Age = n.GetDoubleValue(); } }, + { "alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, + { "backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, + { "countryCode", n => { CountryCode = n.GetStringValue(); } }, + { "creditCard", n => { CreditCard = n.GetStringValue(); } }, + { "email", n => { Email = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, + { "nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "phone", n => { Phone = n.GetStringValue(); } }, + { "planet", n => { Planet = n.GetStringValue(); } }, + { "profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "userName", n => { UserName = n.GetStringValue(); } }, + { "validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, + { "validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, + { "validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs index 733f871101..7beca89a63 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/CreateSocialMediaAccountRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateSocialMediaAccountRequestDocument : IBackedModel, IParsable + public class CreateSocialMediaAccountRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateSocialMediaAccountRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateSocialMediaAccountRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInCreateSocialMediaAccountRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateSocialMediaAccountRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInCreateSocialMediaAccountRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateSocialMediaAccountRequestDocument() { @@ -36,12 +39,12 @@ public CreateSocialMediaAccountRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateSocialMediaAccountRequestDocument(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs index df1855bd22..fdfb8d5931 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInCreateSocialMediaAccountRequest.cs @@ -5,34 +5,38 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateSocialMediaAccountRequest : IBackedModel, IParsable + public class DataInCreateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateSocialMediaAccountRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInCreateSocialMediaAccountRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateSocialMediaAccountRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInCreateSocialMediaAccountRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The type property - public SocialMediaAccountResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateSocialMediaAccountRequest() { @@ -41,12 +45,12 @@ public DataInCreateSocialMediaAccountRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInCreateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateSocialMediaAccountRequest(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInCreateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInCreateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -67,8 +71,8 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs index 932e4dc2c8..dbd6d3a4e3 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,16 +55,16 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "socialMediaAccounts" => new SocialMediaAccountDataInResponse(), - _ => new DataInResponse(), + "socialMediaAccounts" => new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInResponse(), }; } /// @@ -70,8 +75,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs index 22389eda3a..dcd3a4140b 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInUpdateSocialMediaAccountRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateSocialMediaAccountRequest : IBackedModel, IParsable + public class DataInUpdateSocialMediaAccountRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateSocialMediaAccountRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInUpdateSocialMediaAccountRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateSocialMediaAccountRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInUpdateSocialMediaAccountRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInUpdateSocialMediaAccountRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public SocialMediaAccountResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateSocialMediaAccountRequest() { @@ -55,12 +61,12 @@ public DataInUpdateSocialMediaAccountRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInUpdateSocialMediaAccountRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateSocialMediaAccountRequest(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInUpdateSocialMediaAccountRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.AttributesInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorLinks.cs index 3a332296fe..18b146eb51 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs index 16e5269395..8e812b36bd 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs index 6edceb8215..4253f69aca 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs index dfba3e4512..272b326c76 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs index 6c77bba3df..786d6d9e11 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorSource.cs index 8a4df7fed9..b924293ea4 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorTopLevelLinks.cs index 15ce3b1b93..2ea0049d33 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceLinks.cs index c9a5c80608..988394a072 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceTopLevelLinks.cs index b13259fe7c..8e029bd99e 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInResponse.cs index 1b759d3605..a99361a63b 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountAttributesInResponse.cs @@ -6,31 +6,36 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class SocialMediaAccountAttributesInResponse : IBackedModel, IParsable + public class SocialMediaAccountAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The age property - public double? Age { + public double? Age + { get { return BackingStore?.Get("age"); } set { BackingStore?.Set("age", value); } } /// The alternativeId property - public Guid? AlternativeId { + public Guid? AlternativeId + { get { return BackingStore?.Get("alternativeId"); } set { BackingStore?.Set("alternativeId", value); } } /// The backgroundPicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? BackgroundPicture { + public string? BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } #nullable restore #else - public string BackgroundPicture { + public string BackgroundPicture + { get { return BackingStore?.Get("backgroundPicture"); } set { BackingStore?.Set("backgroundPicture", value); } } @@ -40,13 +45,15 @@ public string BackgroundPicture { /// The countryCode property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CountryCode { + public string? CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } #nullable restore #else - public string CountryCode { + public string CountryCode + { get { return BackingStore?.Get("countryCode"); } set { BackingStore?.Set("countryCode", value); } } @@ -54,13 +61,15 @@ public string CountryCode { /// The creditCard property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? CreditCard { + public string? CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } #nullable restore #else - public string CreditCard { + public string CreditCard + { get { return BackingStore?.Get("creditCard"); } set { BackingStore?.Set("creditCard", value); } } @@ -68,13 +77,15 @@ public string CreditCard { /// The email property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Email { + public string? Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } #nullable restore #else - public string Email { + public string Email + { get { return BackingStore?.Get("email"); } set { BackingStore?.Set("email", value); } } @@ -82,13 +93,15 @@ public string Email { /// The firstName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? FirstName { + public string? FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } #nullable restore #else - public string FirstName { + public string FirstName + { get { return BackingStore?.Get("firstName"); } set { BackingStore?.Set("firstName", value); } } @@ -96,13 +109,15 @@ public string FirstName { /// The lastName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? LastName { + public string? LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } #nullable restore #else - public string LastName { + public string LastName + { get { return BackingStore?.Get("lastName"); } set { BackingStore?.Set("lastName", value); } } @@ -110,13 +125,15 @@ public string LastName { /// The nextRevalidation property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? NextRevalidation { + public string? NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } #nullable restore #else - public string NextRevalidation { + public string NextRevalidation + { get { return BackingStore?.Get("nextRevalidation"); } set { BackingStore?.Set("nextRevalidation", value); } } @@ -124,13 +141,15 @@ public string NextRevalidation { /// The password property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Password { + public string? Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } #nullable restore #else - public string Password { + public string Password + { get { return BackingStore?.Get("password"); } set { BackingStore?.Set("password", value); } } @@ -138,13 +157,15 @@ public string Password { /// The phone property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Phone { + public string? Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } #nullable restore #else - public string Phone { + public string Phone + { get { return BackingStore?.Get("phone"); } set { BackingStore?.Set("phone", value); } } @@ -152,13 +173,15 @@ public string Phone { /// The planet property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Planet { + public string? Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } #nullable restore #else - public string Planet { + public string Planet + { get { return BackingStore?.Get("planet"); } set { BackingStore?.Set("planet", value); } } @@ -166,13 +189,15 @@ public string Planet { /// The profilePicture property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? ProfilePicture { + public string? ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } #nullable restore #else - public string ProfilePicture { + public string ProfilePicture + { get { return BackingStore?.Get("profilePicture"); } set { BackingStore?.Set("profilePicture", value); } } @@ -180,13 +205,15 @@ public string ProfilePicture { /// The tags property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Tags { + public List? Tags + { get { return BackingStore?.Get?>("tags"); } set { BackingStore?.Set("tags", value); } } #nullable restore #else - public List Tags { + public List Tags + { get { return BackingStore?.Get>("tags"); } set { BackingStore?.Set("tags", value); } } @@ -194,34 +221,39 @@ public List Tags { /// The userName property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? UserName { + public string? UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #nullable restore #else - public string UserName { + public string UserName + { get { return BackingStore?.Get("userName"); } set { BackingStore?.Set("userName", value); } } #endif /// The validatedAt property - public DateTimeOffset? ValidatedAt { + public DateTimeOffset? ValidatedAt + { get { return BackingStore?.Get("validatedAt"); } set { BackingStore?.Set("validatedAt", value); } } /// The validatedAtDate property - public Date? ValidatedAtDate { + public Date? ValidatedAtDate + { get { return BackingStore?.Get("validatedAtDate"); } set { BackingStore?.Set("validatedAtDate", value); } } /// The validatedAtTime property - public Time? ValidatedAtTime { + public Time? ValidatedAtTime + { get { return BackingStore?.Get("validatedAtTime"); } set { BackingStore?.Set("validatedAtTime", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public SocialMediaAccountAttributesInResponse() { @@ -230,12 +262,12 @@ public SocialMediaAccountAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse(); } /// /// The deserialization information for the current model @@ -245,24 +277,24 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"age", n => { Age = n.GetDoubleValue(); } }, - {"alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, - {"backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, - {"countryCode", n => { CountryCode = n.GetStringValue(); } }, - {"creditCard", n => { CreditCard = n.GetStringValue(); } }, - {"email", n => { Email = n.GetStringValue(); } }, - {"firstName", n => { FirstName = n.GetStringValue(); } }, - {"lastName", n => { LastName = n.GetStringValue(); } }, - {"nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, - {"password", n => { Password = n.GetStringValue(); } }, - {"phone", n => { Phone = n.GetStringValue(); } }, - {"planet", n => { Planet = n.GetStringValue(); } }, - {"profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, - {"tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, - {"userName", n => { UserName = n.GetStringValue(); } }, - {"validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, - {"validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, - {"validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, + { "age", n => { Age = n.GetDoubleValue(); } }, + { "alternativeId", n => { AlternativeId = n.GetGuidValue(); } }, + { "backgroundPicture", n => { BackgroundPicture = n.GetStringValue(); } }, + { "countryCode", n => { CountryCode = n.GetStringValue(); } }, + { "creditCard", n => { CreditCard = n.GetStringValue(); } }, + { "email", n => { Email = n.GetStringValue(); } }, + { "firstName", n => { FirstName = n.GetStringValue(); } }, + { "lastName", n => { LastName = n.GetStringValue(); } }, + { "nextRevalidation", n => { NextRevalidation = n.GetStringValue(); } }, + { "password", n => { Password = n.GetStringValue(); } }, + { "phone", n => { Phone = n.GetStringValue(); } }, + { "planet", n => { Planet = n.GetStringValue(); } }, + { "profilePicture", n => { ProfilePicture = n.GetStringValue(); } }, + { "tags", n => { Tags = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "userName", n => { UserName = n.GetStringValue(); } }, + { "validatedAt", n => { ValidatedAt = n.GetDateTimeOffsetValue(); } }, + { "validatedAtDate", n => { ValidatedAtDate = n.GetDateValue(); } }, + { "validatedAtTime", n => { ValidatedAtTime = n.GetTimeValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs index 7344e1f916..3d9a4af69e 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class SocialMediaAccountDataInResponse : DataInResponse, IParsable + public class SocialMediaAccountDataInResponse : OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public SocialMediaAccountAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public SocialMediaAccountDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new SocialMediaAccountDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountDataInResponse(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(SocialMediaAccountAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(SocialMediaAccountDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs index daa2f4eaf2..19d72bccc3 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class SocialMediaAccountDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class SocialMediaAccountDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public SocialMediaAccountDataInResponse_meta() { @@ -28,12 +30,12 @@ public SocialMediaAccountDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs index 8bcf6b5010..703b0ca10e 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class SocialMediaAccountPrimaryResponseDocument : IBackedModel, IParsable + public class SocialMediaAccountPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class SocialMediaAccountPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccounts? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public SocialMediaAccounts Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public SocialMediaAccountPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public SocialMediaAccountPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public SocialMediaAccountPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public SocialMediaAccountPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(SocialMediaAccounts.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(SocialMediaAccountPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs index 94efbdee26..80d3e82398 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class SocialMediaAccountPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class SocialMediaAccountPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public SocialMediaAccountPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public SocialMediaAccountPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccountPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccountPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountResourceType.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountResourceType.cs index da2c2ce427..4fb53e415b 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum SocialMediaAccountResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts.cs deleted file mode 100644 index 9c56d76975..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { - #pragma warning disable CS1591 - public class SocialMediaAccounts : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public SocialMediaAccountAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public SocialMediaAccountAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public SocialMediaAccounts_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public SocialMediaAccounts_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new SocialMediaAccounts CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccounts(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(SocialMediaAccountAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(SocialMediaAccounts_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts_meta.cs deleted file mode 100644 index 0f2bcb4057..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccounts_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { - #pragma warning disable CS1591 - public class SocialMediaAccounts_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public SocialMediaAccounts_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static SocialMediaAccounts_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new SocialMediaAccounts_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs index 7d6a921e71..4e4b605d92 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/UpdateSocialMediaAccountRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateSocialMediaAccountRequestDocument : IBackedModel, IParsable + public class UpdateSocialMediaAccountRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateSocialMediaAccountRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateSocialMediaAccountRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInUpdateSocialMediaAccountRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateSocialMediaAccountRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInUpdateSocialMediaAccountRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateSocialMediaAccountRequestDocument() { @@ -36,12 +39,12 @@ public UpdateSocialMediaAccountRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateSocialMediaAccountRequestDocument(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInUpdateSocialMediaAccountRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs index 998fb83165..09c3154906 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/Item/SocialMediaAccountsItemRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item +{ /// /// Builds and executes requests for operations under \socialMediaAccounts\{id} /// - public class SocialMediaAccountsItemRequestBuilder : BaseRequestBuilder + public class SocialMediaAccountsItemRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public SocialMediaAccountsItemRequestBuilder(Dictionary pathPara { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,33 +34,33 @@ public SocialMediaAccountsItemRequestBuilder(string rawUrl, IRequestAdapter requ /// /// Updates an existing socialMediaAccount. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, SocialMediaAccountPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Updates an existing socialMediaAccount. @@ -69,11 +70,11 @@ public async Task PatchAsync(UpdateSo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.UpdateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -86,11 +87,11 @@ public RequestInformation ToPatchRequestInformation(UpdateSocialMediaAccountRequ /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public SocialMediaAccountsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item.SocialMediaAccountsItemRequestBuilder WithUrl(string rawUrl) { - return new SocialMediaAccountsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item.SocialMediaAccountsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Updates an existing socialMediaAccount. diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs index 37f4db7a30..4cb893bccd 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/SocialMediaAccounts/SocialMediaAccountsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts { +namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts +{ /// /// Builds and executes requests for operations under \socialMediaAccounts /// - public class SocialMediaAccountsRequestBuilder : BaseRequestBuilder + public class SocialMediaAccountsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.socialMediaAccounts.item collection /// The identifier of the socialMediaAccount to update. - /// A - public SocialMediaAccountsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item.SocialMediaAccountsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new SocialMediaAccountsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.Item.SocialMediaAccountsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public SocialMediaAccountsRequestBuilder(Dictionary pathParamete { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,35 +47,35 @@ public SocialMediaAccountsRequestBuilder(string rawUrl, IRequestAdapter requestA /// /// Creates a new socialMediaAccount. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, SocialMediaAccountPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new socialMediaAccount. @@ -84,11 +85,11 @@ public async Task PostAsync(CreateSoc /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.CreateSocialMediaAccountRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -101,11 +102,11 @@ public RequestInformation ToPostRequestInformation(CreateSocialMediaAccountReque /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public SocialMediaAccountsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.SocialMediaAccountsRequestBuilder WithUrl(string rawUrl) { - return new SocialMediaAccountsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.SocialMediaAccounts.SocialMediaAccountsRequestBuilder(rawUrl, RequestAdapter); } /// /// Creates a new socialMediaAccount. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs index 50af4daada..e6313bb6d0 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNameValuePairRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateNameValuePairRequest : IBackedModel, IParsable + public class AttributesInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInCreateNameValuePairRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } @@ -29,19 +32,21 @@ public string Name { /// The value property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { + public string? Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #nullable restore #else - public string Value { + public string Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateNameValuePairRequest() { @@ -50,12 +55,12 @@ public AttributesInCreateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"value", n => { Value = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs index 95e7d67199..ddd4bf8444 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInCreateNodeRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateNodeRequest : IBackedModel, IParsable + public class AttributesInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInCreateNodeRequest : IBackedModel, IParsable /// The comment property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Comment { + public string? Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } #nullable restore #else - public string Comment { + public string Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } @@ -29,19 +32,21 @@ public string Comment { /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateNodeRequest() { @@ -50,12 +55,12 @@ public AttributesInCreateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNodeRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"comment", n => { Comment = n.GetStringValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "comment", n => { Comment = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs index b3cd44f741..9d64a8cba6 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNameValuePairRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateNameValuePairRequest : IBackedModel, IParsable + public class AttributesInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInUpdateNameValuePairRequest : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } @@ -29,19 +32,21 @@ public string Name { /// The value property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { + public string? Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #nullable restore #else - public string Value { + public string Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateNameValuePairRequest() { @@ -50,12 +55,12 @@ public AttributesInUpdateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"value", n => { Value = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs index 194641d8db..62a704bbc6 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/AttributesInUpdateNodeRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateNodeRequest : IBackedModel, IParsable + public class AttributesInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class AttributesInUpdateNodeRequest : IBackedModel, IParsable /// The comment property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Comment { + public string? Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } #nullable restore #else - public string Comment { + public string Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } @@ -29,19 +32,21 @@ public string Comment { /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateNodeRequest() { @@ -50,12 +55,12 @@ public AttributesInUpdateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNodeRequest(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"comment", n => { Comment = n.GetStringValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "comment", n => { Comment = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs index ecaac721ba..a01b2245ab 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNameValuePairRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateNameValuePairRequestDocument : IBackedModel, IParsable + public class CreateNameValuePairRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateNameValuePairRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateNameValuePairRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNameValuePairRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateNameValuePairRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNameValuePairRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateNameValuePairRequestDocument() { @@ -36,12 +39,12 @@ public CreateNameValuePairRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateNameValuePairRequestDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs index dcc9433def..1234c73554 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/CreateNodeRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateNodeRequestDocument : IBackedModel, IParsable + public class CreateNodeRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateNodeRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateNodeRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNodeRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateNodeRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNodeRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateNodeRequestDocument() { @@ -36,12 +39,12 @@ public CreateNodeRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateNodeRequestDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateNodeRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNodeRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs index 1aa8fead9f..491388e016 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNameValuePairRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateNameValuePairRequest : IBackedModel, IParsable + public class DataInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateNameValuePairRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNameValuePairRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateNameValuePairRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNameValuePairRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateNameValuePairRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateNameValuePairRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNameValuePairRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateNameValuePairRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNameValuePairRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public NameValuePairResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateNameValuePairRequest() { @@ -55,12 +61,12 @@ public DataInCreateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs index 0aac0f38c9..9525318a96 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInCreateNodeRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateNodeRequest : IBackedModel, IParsable + public class DataInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateNodeRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNodeRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateNodeRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNodeRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateNodeRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateNodeRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNodeRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateNodeRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNodeRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public NodeResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateNodeRequest() { @@ -55,12 +61,12 @@ public DataInCreateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInCreateNodeRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateNodeRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateNodeRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInCreateNodeRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNodeRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs index 52fc573ea0..86201f381a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,17 +55,17 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "nameValuePairs" => new NameValuePairDataInResponse(), - "nodes" => new NodeDataInResponse(), - _ => new DataInResponse(), + "nameValuePairs" => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse(), + "nodes" => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse(), }; } /// @@ -71,8 +76,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs index e1a58daae4..92f7f97597 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNameValuePairRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateNameValuePairRequest : IBackedModel, IParsable + public class DataInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateNameValuePairRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNameValuePairRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateNameValuePairRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNameValuePairRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateNameValuePairRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateNameValuePairRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNameValuePairRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateNameValuePairRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNameValuePairRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public NameValuePairResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateNameValuePairRequest() { @@ -69,12 +77,12 @@ public DataInUpdateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs index e26a0224e3..6f7c2abbfc 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInUpdateNodeRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateNodeRequest : IBackedModel, IParsable + public class DataInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateNodeRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNodeRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateNodeRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNodeRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateNodeRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateNodeRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNodeRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateNodeRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNodeRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public NodeResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateNodeRequest() { @@ -69,12 +77,12 @@ public DataInUpdateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNodeRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.AttributesInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorLinks.cs index 3b203b8011..efa34c34a8 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs index 47aa67b46c..321cf96703 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs index c6a6446601..b6568886b1 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs index 7d2a0644be..412d826b28 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs index d2803490b2..e646b8cd48 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorSource.cs index 3a098bc435..b30d343449 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorTopLevelLinks.cs index 7aa06396fa..b6a7e92edd 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInResponse.cs index 720102697b..3acf0ccb95 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairAttributesInResponse : IBackedModel, IParsable + public class NameValuePairAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class NameValuePairAttributesInResponse : IBackedModel, IParsable /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } @@ -29,19 +32,21 @@ public string Name { /// The value property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Value { + public string? Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #nullable restore #else - public string Value { + public string Value + { get { return BackingStore?.Get("value"); } set { BackingStore?.Set("value", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairAttributesInResponse() { @@ -50,12 +55,12 @@ public NameValuePairAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"name", n => { Name = n.GetStringValue(); } }, - {"value", n => { Value = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + { "value", n => { Value = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs index 713494e741..de1dbeb66f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairCollectionResponseDocument : IBackedModel, IParsable + public class NameValuePairCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NameValuePairCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NameValuePairCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairCollectionResponseDocument() { @@ -78,12 +87,12 @@ public NameValuePairCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NameValuePairDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NameValuePairCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs index 8fa271ba8d..b3cbb4b580 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NameValuePairCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public NameValuePairCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs index 52f7a6358f..ddae8300cd 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairDataInResponse : DataInResponse, IParsable + public class NameValuePairDataInResponse : OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NameValuePairAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NameValuePairDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NameValuePairRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new NameValuePairDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairDataInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(NameValuePairAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NameValuePairDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NameValuePairRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs index e728bc1a88..67a0002e77 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NameValuePairDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairDataInResponse_meta() { @@ -28,12 +30,12 @@ public NameValuePairDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs index 264a6d2939..ccea4c0bad 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairIdentifier : IBackedModel, IParsable + public class NameValuePairIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class NameValuePairIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public NameValuePairResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairIdentifier() { @@ -41,12 +45,12 @@ public NameValuePairIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairIdentifier(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs index f581ce32e9..2609e84ac2 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class NameValuePairIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NameValuePairIdentifierCollectionResponseDocument : IBackedModel, I /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NameValuePairIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public NameValuePairIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairIdentifierCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NameValuePairIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs index 33d795448f..3f729ee057 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NameValuePairIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public NameValuePairIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs index 6b98c54fb3..ada9ff0a70 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairPrimaryResponseDocument : IBackedModel, IParsable + public class NameValuePairPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NameValuePairPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairs? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NameValuePairs Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NameValuePairPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NameValuePairPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public NameValuePairPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NameValuePairs.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NameValuePairPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs index 4f838feec5..299966002e 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NameValuePairPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NameValuePairPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInResponse.cs index 5972d22b29..ce4265d618 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NameValuePairRelationshipsInResponse : IBackedModel, IParsable + public class NameValuePairRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class NameValuePairRelationshipsInResponse : IBackedModel, IParsable /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneNodeInResponse? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOneNodeInResponse Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NameValuePairRelationshipsInResponse() { @@ -36,12 +39,12 @@ public NameValuePairRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NameValuePairRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"owner", n => { Owner = n.GetObjectValue(ToOneNodeInResponse.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("owner", Owner); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairResourceType.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairResourceType.cs index 6a22c528d1..fbe04c2e5a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum NameValuePairResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs.cs deleted file mode 100644 index 9d32fbd7c3..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class NameValuePairs : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NameValuePairAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public NameValuePairAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NameValuePairs_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public NameValuePairs_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NameValuePairRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public NameValuePairRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new NameValuePairs CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairs(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(NameValuePairAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NameValuePairs_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NameValuePairRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs_meta.cs deleted file mode 100644 index 2014abb699..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairs_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class NameValuePairs_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NameValuePairs_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static NameValuePairs_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NameValuePairs_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInResponse.cs index ede8c0d333..5fd0c2bffa 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeAttributesInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeAttributesInResponse : IBackedModel, IParsable + public class NodeAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class NodeAttributesInResponse : IBackedModel, IParsable /// The comment property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Comment { + public string? Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } #nullable restore #else - public string Comment { + public string Comment + { get { return BackingStore?.Get("comment"); } set { BackingStore?.Set("comment", value); } } @@ -29,19 +32,21 @@ public string Comment { /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeAttributesInResponse() { @@ -50,12 +55,12 @@ public NodeAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"comment", n => { Comment = n.GetStringValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "comment", n => { Comment = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs index e3c2e38f6b..9d45543225 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeCollectionResponseDocument : IBackedModel, IParsable + public class NodeCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NodeCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodeCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeCollectionResponseDocument() { @@ -78,12 +87,12 @@ public NodeCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NodeDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodeCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs index 84c71fd68c..7749357a7d 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodeCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public NodeCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs index 91931e4249..950404f602 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeDataInResponse : DataInResponse, IParsable + public class NodeDataInResponse : OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public NodeAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodeDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public NodeRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new NodeDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeDataInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodeDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs index aab4a832ef..8978eec33b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodeDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeDataInResponse_meta() { @@ -28,12 +30,12 @@ public NodeDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs index 185eff0c5d..0c865eca81 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeIdentifier : IBackedModel, IParsable + public class NodeIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class NodeIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public NodeResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeIdentifier() { @@ -41,12 +45,12 @@ public NodeIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeIdentifier(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs index 7c5f4eba06..b3abca814a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class NodeIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NodeIdentifierCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodeIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public NodeIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeIdentifierCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodeIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs index 7b6548d92f..e520b3dc0e 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodeIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public NodeIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs index 1f859678d1..94f049e176 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeIdentifierResponseDocument : IBackedModel, IParsable + public class NodeIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NodeIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodeIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public NodeIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs index 15a6109bab..d1a8a2d869 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public NodeIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs index b13a3e8f26..c506d23654 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodePrimaryResponseDocument : IBackedModel, IParsable + public class NodePrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NodePrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Nodes? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Nodes Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodePrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodePrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodePrimaryResponseDocument() { @@ -78,12 +87,12 @@ public NodePrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodePrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodePrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Nodes.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs index b190a8fcd9..8a34481ea8 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodePrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NodePrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodePrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInResponse.cs index 0c946971a1..0a8eb93fc9 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeRelationshipsInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeRelationshipsInResponse : IBackedModel, IParsable + public class NodeRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NodeRelationshipsInResponse : IBackedModel, IParsable /// The children property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNodeInResponse? Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse? Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #nullable restore #else - public ToManyNodeInResponse Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #endif /// The parent property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneNodeInResponse? Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse? Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #nullable restore #else - public NullableToOneNodeInResponse Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #endif /// The values property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNameValuePairInResponse? Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse? Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #nullable restore #else - public ToManyNameValuePairInResponse Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeRelationshipsInResponse() { @@ -64,12 +71,12 @@ public NodeRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"children", n => { Children = n.GetObjectValue(ToManyNodeInResponse.CreateFromDiscriminatorValue); } }, - {"parent", n => { Parent = n.GetObjectValue(NullableToOneNodeInResponse.CreateFromDiscriminatorValue); } }, - {"values", n => { Values = n.GetObjectValue(ToManyNameValuePairInResponse.CreateFromDiscriminatorValue); } }, + { "children", n => { Children = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse.CreateFromDiscriminatorValue); } }, + { "parent", n => { Parent = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("children", Children); - writer.WriteObjectValue("parent", Parent); - writer.WriteObjectValue("values", Values); + writer.WriteObjectValue("children", Children); + writer.WriteObjectValue("parent", Parent); + writer.WriteObjectValue("values", Values); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeResourceType.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeResourceType.cs index 3e2a0dc13a..a6f6e71483 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum NodeResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs index b236f90018..6e0bdd0f01 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeSecondaryResponseDocument : IBackedModel, IParsable + public class NodeSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NodeSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Owner? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Owner Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NodeSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public NodeSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Owner.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs index fd693b2516..8b56b30af0 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NodeSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NodeSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NodeSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes.cs deleted file mode 100644 index c55696b919..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Nodes : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public NodeAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Nodes_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Nodes_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public NodeRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Nodes CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Nodes(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Nodes_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes_meta.cs deleted file mode 100644 index 9a3dbf4013..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Nodes_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Nodes_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Nodes_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Nodes_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Nodes_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs index 6cbd84b620..c9e095706a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableNodeIdentifierResponseDocument : IBackedModel, IParsable + public class NullableNodeIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableNodeIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableNodeIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableNodeIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableNodeIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public NullableNodeIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableNodeIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableNodeIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableNodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs index 36ef3abd0b..d57fc94360 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableNodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableNodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableNodeIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableNodeIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableNodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableNodeIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs index f18b10c534..5b6ff3be7f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableNodeSecondaryResponseDocument : IBackedModel, IParsable + public class NullableNodeSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NullableNodeSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public Parent? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public Parent Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableNodeSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableNodeSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableNodeSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public NullableNodeSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableNodeSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableNodeSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(Parent.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableNodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs index 54c8510817..731da321ac 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableNodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableNodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableNodeSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableNodeSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableNodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableNodeSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs index 61c0348ecd..a7a9ab7ac2 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneNodeInRequest : IBackedModel, IParsable + public class NullableToOneNodeInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class NullableToOneNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneNodeInRequest() { @@ -36,12 +39,12 @@ public NullableToOneNodeInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneNodeInRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs index 3ef6be985e..b35dc4c8a4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneNodeInResponse : IBackedModel, IParsable + public class NullableToOneNodeInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableToOneNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneNodeInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableToOneNodeInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneNodeInResponse() { @@ -64,12 +71,12 @@ public NullableToOneNodeInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneNodeInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs index da674086b6..6d44e685b7 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneNodeInResponse_meta() { @@ -28,12 +30,12 @@ public NullableToOneNodeInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneNodeInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner.cs deleted file mode 100644 index 5eeb30af2d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Owner : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public NodeAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Owner_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Owner_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public NodeRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Owner CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Owner(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Owner_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner_meta.cs deleted file mode 100644 index 8d1bc43922..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Owner_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Owner_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Owner_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Owner_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Owner_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent.cs deleted file mode 100644 index 251722475e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Parent : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public NodeAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public Parent_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public Parent_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public NodeRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public NodeRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new Parent CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Parent(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(Parent_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent_meta.cs deleted file mode 100644 index 70b9c6f7ff..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Parent_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { - #pragma warning disable CS1591 - public class Parent_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public Parent_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static Parent_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new Parent_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipLinks.cs index 4f6ccc268f..234e64eb80 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs index 94e8dfddf3..15b327a003 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNameValuePairRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateNameValuePairRequest : IBackedModel, IParsable + public class RelationshipsInCreateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInCreateNameValuePairRequest : IBackedModel, IParsable /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneNodeInRequest? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOneNodeInRequest Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateNameValuePairRequest() { @@ -36,12 +39,12 @@ public RelationshipsInCreateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"owner", n => { Owner = n.GetObjectValue(ToOneNodeInRequest.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("owner", Owner); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs index 8af49e0d69..15882c4f70 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInCreateNodeRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateNodeRequest : IBackedModel, IParsable + public class RelationshipsInCreateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class RelationshipsInCreateNodeRequest : IBackedModel, IParsable /// The children property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNodeInRequest? Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest? Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #nullable restore #else - public ToManyNodeInRequest Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #endif /// The parent property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneNodeInRequest? Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest? Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #nullable restore #else - public NullableToOneNodeInRequest Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #endif /// The values property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNameValuePairInRequest? Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest? Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #nullable restore #else - public ToManyNameValuePairInRequest Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateNodeRequest() { @@ -64,12 +71,12 @@ public RelationshipsInCreateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInCreateNodeRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"children", n => { Children = n.GetObjectValue(ToManyNodeInRequest.CreateFromDiscriminatorValue); } }, - {"parent", n => { Parent = n.GetObjectValue(NullableToOneNodeInRequest.CreateFromDiscriminatorValue); } }, - {"values", n => { Values = n.GetObjectValue(ToManyNameValuePairInRequest.CreateFromDiscriminatorValue); } }, + { "children", n => { Children = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest.CreateFromDiscriminatorValue); } }, + { "parent", n => { Parent = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("children", Children); - writer.WriteObjectValue("parent", Parent); - writer.WriteObjectValue("values", Values); + writer.WriteObjectValue("children", Children); + writer.WriteObjectValue("parent", Parent); + writer.WriteObjectValue("values", Values); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs index e5e6896556..ab2b55f058 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNameValuePairRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateNameValuePairRequest : IBackedModel, IParsable + public class RelationshipsInUpdateNameValuePairRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class RelationshipsInUpdateNameValuePairRequest : IBackedModel, IParsable /// The owner property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneNodeInRequest? Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest? Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #nullable restore #else - public ToOneNodeInRequest Owner { - get { return BackingStore?.Get("owner"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest Owner + { + get { return BackingStore?.Get("owner"); } set { BackingStore?.Set("owner", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateNameValuePairRequest() { @@ -36,12 +39,12 @@ public RelationshipsInUpdateNameValuePairRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNameValuePairRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateNameValuePairRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNameValuePairRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"owner", n => { Owner = n.GetObjectValue(ToOneNodeInRequest.CreateFromDiscriminatorValue); } }, + { "owner", n => { Owner = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("owner", Owner); + writer.WriteObjectValue("owner", Owner); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs index 20efe61da6..584c8aec61 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/RelationshipsInUpdateNodeRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateNodeRequest : IBackedModel, IParsable + public class RelationshipsInUpdateNodeRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class RelationshipsInUpdateNodeRequest : IBackedModel, IParsable /// The children property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNodeInRequest? Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest? Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #nullable restore #else - public ToManyNodeInRequest Children { - get { return BackingStore?.Get("children"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest Children + { + get { return BackingStore?.Get("children"); } set { BackingStore?.Set("children", value); } } #endif /// The parent property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneNodeInRequest? Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest? Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #nullable restore #else - public NullableToOneNodeInRequest Parent { - get { return BackingStore?.Get("parent"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest Parent + { + get { return BackingStore?.Get("parent"); } set { BackingStore?.Set("parent", value); } } #endif /// The values property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNameValuePairInRequest? Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest? Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #nullable restore #else - public ToManyNameValuePairInRequest Values { - get { return BackingStore?.Get("values"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest Values + { + get { return BackingStore?.Get("values"); } set { BackingStore?.Set("values", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateNodeRequest() { @@ -64,12 +71,12 @@ public RelationshipsInUpdateNodeRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNodeRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateNodeRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipsInUpdateNodeRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"children", n => { Children = n.GetObjectValue(ToManyNodeInRequest.CreateFromDiscriminatorValue); } }, - {"parent", n => { Parent = n.GetObjectValue(NullableToOneNodeInRequest.CreateFromDiscriminatorValue); } }, - {"values", n => { Values = n.GetObjectValue(ToManyNameValuePairInRequest.CreateFromDiscriminatorValue); } }, + { "children", n => { Children = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest.CreateFromDiscriminatorValue); } }, + { "parent", n => { Parent = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest.CreateFromDiscriminatorValue); } }, + { "values", n => { Values = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("children", Children); - writer.WriteObjectValue("parent", Parent); - writer.WriteObjectValue("values", Values); + writer.WriteObjectValue("children", Children); + writer.WriteObjectValue("parent", Parent); + writer.WriteObjectValue("values", Values); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs index b09caa9c46..14c1dfa8ad 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,19 +96,21 @@ public string Prev { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceCollectionTopLevelLinks() { @@ -106,12 +119,12 @@ public ResourceCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -121,12 +134,12 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs index 2aa7a46d81..f22c30f977 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,13 +96,15 @@ public string Prev { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -99,19 +112,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierCollectionTopLevelLinks() { @@ -120,12 +135,12 @@ public ResourceIdentifierCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -135,13 +150,13 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs index 9698cf7eae..a26c51f6f0 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -43,19 +48,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierTopLevelLinks() { @@ -64,12 +71,12 @@ public ResourceIdentifierTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceLinks.cs index 67badc62f7..8a18967c04 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceTopLevelLinks.cs index 542fe43728..bc1656f1f3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs index 6b5c855876..ed04da086e 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNameValuePairInRequest : IBackedModel, IParsable + public class ToManyNameValuePairInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyNameValuePairInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNameValuePairInRequest() { @@ -36,12 +39,12 @@ public ToManyNameValuePairInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNameValuePairInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNameValuePairInRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs index efaf1608b8..0f2c061253 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNameValuePairInResponse : IBackedModel, IParsable + public class ToManyNameValuePairInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyNameValuePairInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNameValuePairInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyNameValuePairInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNameValuePairInResponse() { @@ -64,12 +71,12 @@ public ToManyNameValuePairInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNameValuePairInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNameValuePairInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyNameValuePairInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs index ebc6cdd65f..2e3b4e6b92 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNameValuePairInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyNameValuePairInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNameValuePairInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyNameValuePairInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNameValuePairInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNameValuePairInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs index 56c3598a8e..3588d956ec 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNodeInRequest : IBackedModel, IParsable + public class ToManyNodeInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNodeInRequest() { @@ -36,12 +39,12 @@ public ToManyNodeInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNodeInRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs index 2a6a5ab4da..96b0bad961 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNodeInResponse : IBackedModel, IParsable + public class ToManyNodeInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyNodeInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyNodeInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNodeInResponse() { @@ -64,12 +71,12 @@ public ToManyNodeInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNodeInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs index b6a1bcf01e..9d67b05215 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyNodeInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyNodeInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyNodeInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs index 857899c979..3ded9739fc 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneNodeInRequest : IBackedModel, IParsable + public class ToOneNodeInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToOneNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneNodeInRequest() { @@ -36,12 +39,12 @@ public ToOneNodeInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneNodeInRequest(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs index 5d608db851..f55d38c1da 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneNodeInResponse : IBackedModel, IParsable + public class ToOneNodeInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToOneNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NodeIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public NodeIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneNodeInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToOneNodeInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneNodeInResponse() { @@ -64,12 +71,12 @@ public ToOneNodeInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneNodeInResponse(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(NodeIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs index aeebc9ba89..f226b3f806 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneNodeInResponse_meta() { @@ -28,12 +30,12 @@ public ToOneNodeInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneNodeInResponse_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs index d16f55a54c..3c62ab04e4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNameValuePairRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateNameValuePairRequestDocument : IBackedModel, IParsable + public class UpdateNameValuePairRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateNameValuePairRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateNameValuePairRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNameValuePairRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateNameValuePairRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNameValuePairRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateNameValuePairRequestDocument() { @@ -36,12 +39,12 @@ public UpdateNameValuePairRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateNameValuePairRequestDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNameValuePairRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs index 659e0db3e4..18e2bc17cf 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/UpdateNodeRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateNodeRequestDocument : IBackedModel, IParsable + public class UpdateNodeRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateNodeRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateNodeRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNodeRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateNodeRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNodeRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateNodeRequestDocument() { @@ -36,12 +39,12 @@ public UpdateNodeRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateNodeRequestDocument(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInUpdateNodeRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs index b0b10d5a5f..f165b44894 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/NameValuePairsItemRequestBuilder.cs @@ -10,24 +10,25 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item +{ /// /// Builds and executes requests for operations under \nameValuePairs\{id} /// - public class NameValuePairsItemRequestBuilder : BaseRequestBuilder + public class NameValuePairsItemRequestBuilder : BaseRequestBuilder { /// The owner property - public OwnerRequestBuilder Owner + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner.OwnerRequestBuilder Owner { - get => new OwnerRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner.OwnerRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -35,7 +36,7 @@ public NameValuePairsItemRequestBuilder(Dictionary pathParameter { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public NameValuePairsItemRequestBuilder(string rawUrl, IRequestAdapter requestAd /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -60,34 +61,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual nameValuePair by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -96,11 +97,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -109,33 +110,33 @@ public async Task HeadAsync(Action /// Updates an existing nameValuePair. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing nameValuePair by its identifier. @@ -163,11 +164,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -182,11 +183,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -201,11 +202,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNameValuePairRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -218,11 +219,11 @@ public RequestInformation ToPatchRequestInformation(UpdateNameValuePairRequestDo /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public NameValuePairsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.NameValuePairsItemRequestBuilder WithUrl(string rawUrl) { - return new NameValuePairsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.NameValuePairsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual nameValuePair by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Owner/OwnerRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Owner/OwnerRequestBuilder.cs index 87f2fb7513..14d8adae56 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Owner/OwnerRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Owner/OwnerRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner +{ /// /// Builds and executes requests for operations under \nameValuePairs\{id}\owner /// - public class OwnerRequestBuilder : BaseRequestBuilder + public class OwnerRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnerRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Retrieves the related node of an individual nameValuePair's owner relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodeSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnerRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner.OwnerRequestBuilder WithUrl(string rawUrl) { - return new OwnerRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Owner.OwnerRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related node of an individual nameValuePair's owner relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/Owner/OwnerRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/Owner/OwnerRequestBuilder.cs index 79a3a358a9..b491160358 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/Owner/OwnerRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/Owner/OwnerRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner +{ /// /// Builds and executes requests for operations under \nameValuePairs\{id}\relationships\owner /// - public class OwnerRequestBuilder : BaseRequestBuilder + public class OwnerRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public OwnerRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public OwnerRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Retrieves the related node identity of an individual nameValuePair's owner relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodeIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToOneNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToOneNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(ToOneNodeInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToOneNodeInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToOneNodeInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(ToOneNodeInRequest body, Act /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public OwnerRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner.OwnerRequestBuilder WithUrl(string rawUrl) { - return new OwnerRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner.OwnerRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related node identity of an individual nameValuePair's owner relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/RelationshipsRequestBuilder.cs index b9c980d4e0..6c46159da0 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/Item/Relationships/RelationshipsRequestBuilder.cs @@ -6,19 +6,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships +{ /// /// Builds and executes requests for operations under \nameValuePairs\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The owner property - public OwnerRequestBuilder Owner + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner.OwnerRequestBuilder Owner { - get => new OwnerRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.Relationships.Owner.OwnerRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -26,7 +27,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs index 45360a63ed..2cb4dd253f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/NameValuePairs/NameValuePairsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs +{ /// /// Builds and executes requests for operations under \nameValuePairs /// - public class NameValuePairsRequestBuilder : BaseRequestBuilder + public class NameValuePairsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.nameValuePairs.item collection /// The identifier of the nameValuePair to retrieve. - /// A - public NameValuePairsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.NameValuePairsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new NameValuePairsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.Item.NameValuePairsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public NameValuePairsRequestBuilder(Dictionary pathParameters, I { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public NameValuePairsRequestBuilder(string rawUrl, IRequestAdapter requestAdapte /// /// Retrieves a collection of nameValuePairs. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new nameValuePair. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of nameValuePairs. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateNameValu /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateNameValuePairRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNameValuePairRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateNameValuePairRequestDoc /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public NameValuePairsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.NameValuePairsRequestBuilder WithUrl(string rawUrl) { - return new NameValuePairsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.NameValuePairsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of nameValuePairs. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Children/ChildrenRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Children/ChildrenRequestBuilder.cs index 72368978b2..bc21e58a9b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Children/ChildrenRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Children/ChildrenRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children +{ /// /// Builds and executes requests for operations under \nodes\{id}\children /// - public class ChildrenRequestBuilder : BaseRequestBuilder + public class ChildrenRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ChildrenRequestBuilder(Dictionary pathParameters, IReques { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public ChildrenRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b /// /// Retrieves the related nodes of an individual node's children relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodeCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ChildrenRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children.ChildrenRequestBuilder WithUrl(string rawUrl) { - return new ChildrenRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children.ChildrenRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related nodes of an individual node's children relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs index 56c05a1947..fd4ef19459 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/NodesItemRequestBuilder.cs @@ -12,34 +12,35 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item +{ /// /// Builds and executes requests for operations under \nodes\{id} /// - public class NodesItemRequestBuilder : BaseRequestBuilder + public class NodesItemRequestBuilder : BaseRequestBuilder { /// The children property - public ChildrenRequestBuilder Children + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children.ChildrenRequestBuilder Children { - get => new ChildrenRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Children.ChildrenRequestBuilder(PathParameters, RequestAdapter); } /// The parent property - public ParentRequestBuilder Parent + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent.ParentRequestBuilder Parent { - get => new ParentRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent.ParentRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// The values property - public ValuesRequestBuilder Values + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values.ValuesRequestBuilder Values { - get => new ValuesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values.ValuesRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public NodesItemRequestBuilder(Dictionary pathParameters, IReque { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -59,7 +60,7 @@ public NodesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -72,34 +73,34 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves an individual node by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -108,11 +109,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -121,33 +122,33 @@ public async Task HeadAsync(Action /// Updates an existing node. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing node by its identifier. @@ -175,11 +176,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -194,11 +195,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -213,11 +214,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateNodeRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateNodeRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.UpdateNodeRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -230,11 +231,11 @@ public RequestInformation ToPatchRequestInformation(UpdateNodeRequestDocument bo /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public NodesItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.NodesItemRequestBuilder WithUrl(string rawUrl) { - return new NodesItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.NodesItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual node by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Parent/ParentRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Parent/ParentRequestBuilder.cs index d40bf6b97e..baf8f42e5a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Parent/ParentRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Parent/ParentRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent +{ /// /// Builds and executes requests for operations under \nodes\{id}\parent /// - public class ParentRequestBuilder : BaseRequestBuilder + public class ParentRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ParentRequestBuilder(Dictionary pathParameters, IRequestA { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public ParentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// /// Retrieves the related node of an individual node's parent relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableNodeSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ParentRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent.ParentRequestBuilder WithUrl(string rawUrl) { - return new ParentRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Parent.ParentRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related node of an individual node's parent relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Children/ChildrenRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Children/ChildrenRequestBuilder.cs index 6bb80412c4..136271ccb7 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Children/ChildrenRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Children/ChildrenRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children +{ /// /// Builds and executes requests for operations under \nodes\{id}\relationships\children /// - public class ChildrenRequestBuilder : BaseRequestBuilder + public class ChildrenRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ChildrenRequestBuilder(Dictionary pathParameters, IReques { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public ChildrenRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : b /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related node identities of an individual node's children relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodeIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyNodeInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyNodeInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyNodeInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyNodeInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyNodeInRequest body, A /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyNodeInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyNodeInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyNodeInRequest body, Ac /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyNodeInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyNodeInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyNodeInRequest body, Act /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ChildrenRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children.ChildrenRequestBuilder WithUrl(string rawUrl) { - return new ChildrenRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children.ChildrenRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related node identities of an individual node's children relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Parent/ParentRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Parent/ParentRequestBuilder.cs index eb0fcd350b..aca38c0cec 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Parent/ParentRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Parent/ParentRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent +{ /// /// Builds and executes requests for operations under \nodes\{id}\relationships\parent /// - public class ParentRequestBuilder : BaseRequestBuilder + public class ParentRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ParentRequestBuilder(Dictionary pathParameters, IRequestA { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public ParentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// /// Retrieves the related node identity of an individual node's parent relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableNodeIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NullableToOneNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NullableToOneNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(NullableToOneNodeInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NullableToOneNodeInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NullableToOneNodeInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(NullableToOneNodeInRequest b /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ParentRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent.ParentRequestBuilder WithUrl(string rawUrl) { - return new ParentRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent.ParentRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related node identity of an individual node's parent relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/RelationshipsRequestBuilder.cs index 6c35d3a6ec..f48fcd45d6 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships +{ /// /// Builds and executes requests for operations under \nodes\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The children property - public ChildrenRequestBuilder Children + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children.ChildrenRequestBuilder Children { - get => new ChildrenRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Children.ChildrenRequestBuilder(PathParameters, RequestAdapter); } /// The parent property - public ParentRequestBuilder Parent + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent.ParentRequestBuilder Parent { - get => new ParentRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Parent.ParentRequestBuilder(PathParameters, RequestAdapter); } /// The values property - public ValuesRequestBuilder Values + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values.ValuesRequestBuilder Values { - get => new ValuesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values.ValuesRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Values/ValuesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Values/ValuesRequestBuilder.cs index fb0f5bc43b..8b341b9baf 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Values/ValuesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Relationships/Values/ValuesRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values +{ /// /// Builds and executes requests for operations under \nodes\{id}\relationships\values /// - public class ValuesRequestBuilder : BaseRequestBuilder + public class ValuesRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ValuesRequestBuilder(Dictionary pathParameters, IRequestA { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public ValuesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related nameValuePair identities of an individual node's values relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Ac /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyNameValuePairInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyNameValuePairInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyNameValuePairInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyNameValuePairInReques /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyNameValuePairInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyNameValuePairInRequest /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyNameValuePairInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyNameValuePairInRequest /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ValuesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values.ValuesRequestBuilder WithUrl(string rawUrl) { - return new ValuesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Relationships.Values.ValuesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related nameValuePair identities of an individual node's values relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Values/ValuesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Values/ValuesRequestBuilder.cs index ff47c92254..3a44db0896 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Values/ValuesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/Item/Values/ValuesRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values +{ /// /// Builds and executes requests for operations under \nodes\{id}\values /// - public class ValuesRequestBuilder : BaseRequestBuilder + public class ValuesRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public ValuesRequestBuilder(Dictionary pathParameters, IRequestA { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public ValuesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : bas /// /// Retrieves the related nameValuePairs of an individual node's values relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NameValuePairCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ValuesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values.ValuesRequestBuilder WithUrl(string rawUrl) { - return new ValuesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.Values.ValuesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related nameValuePairs of an individual node's values relationship. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs index e718b2c305..7c514e2a1a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Nodes/NodesRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes +{ /// /// Builds and executes requests for operations under \nodes /// - public class NodesRequestBuilder : BaseRequestBuilder + public class NodesRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.nodes.item collection /// The identifier of the node to retrieve. - /// A - public NodesItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.NodesItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new NodesItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.Item.NodesItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public NodesRequestBuilder(Dictionary pathParameters, IRequestAd { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public NodesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base /// /// Retrieves a collection of nodes. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodeCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -86,35 +87,35 @@ public async Task HeadAsync(Action /// Creates a new node. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves a collection of nodes. @@ -123,11 +124,11 @@ public async Task PostAsync(CreateNodeRequestDocume /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -142,11 +143,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -161,11 +162,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateNodeRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateNodeRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.CreateNodeRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -178,11 +179,11 @@ public RequestInformation ToPostRequestInformation(CreateNodeRequestDocument bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public NodesRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.NodesRequestBuilder WithUrl(string rawUrl) { - return new NodesRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.NodesRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of nodes. diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs index bf1abae332..33a530a2f4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs @@ -13,24 +13,25 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class QueryStringsClient : BaseRequestBuilder + public class QueryStringsClient : BaseRequestBuilder { /// The nameValuePairs property - public NameValuePairsRequestBuilder NameValuePairs + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.NameValuePairsRequestBuilder NameValuePairs { - get => new NameValuePairsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.NameValuePairs.NameValuePairsRequestBuilder(PathParameters, RequestAdapter); } /// The nodes property - public NodesRequestBuilder Nodes + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.NodesRequestBuilder Nodes { - get => new NodesRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Nodes.NodesRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/DataStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/DataStreamsRequestBuilder.cs index 05edbc6e76..0256404cd2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/DataStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/DataStreamsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams +{ /// /// Builds and executes requests for operations under \dataStreams /// - public class DataStreamsRequestBuilder : BaseRequestBuilder + public class DataStreamsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.dataStreams.item collection /// The identifier of the dataStream to retrieve. - /// A - public DataStreamsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item.DataStreamsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new DataStreamsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item.DataStreamsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public DataStreamsRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public DataStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves a collection of dataStreams. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -90,11 +91,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -109,11 +110,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -123,11 +124,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public DataStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.DataStreamsRequestBuilder WithUrl(string rawUrl) { - return new DataStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.DataStreamsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of dataStreams. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/Item/DataStreamsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/Item/DataStreamsItemRequestBuilder.cs index da5b4c4afa..2594ce7bb4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/Item/DataStreamsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/DataStreams/Item/DataStreamsItemRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item +{ /// /// Builds and executes requests for operations under \dataStreams\{id} /// - public class DataStreamsItemRequestBuilder : BaseRequestBuilder + public class DataStreamsItemRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public DataStreamsItemRequestBuilder(Dictionary pathParameters, { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public DataStreamsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapt /// /// Retrieves an individual dataStream by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public DataStreamsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item.DataStreamsItemRequestBuilder WithUrl(string rawUrl) { - return new DataStreamsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.Item.DataStreamsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual dataStream by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs index 383938062a..eb6cac341c 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInCreateWriteOnlyChannelRequest.cs @@ -5,39 +5,44 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInCreateWriteOnlyChannelRequest : IBackedModel, IParsable + public class AttributesInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The isAdultOnly property - public bool? IsAdultOnly { + public bool? IsAdultOnly + { get { return BackingStore?.Get("isAdultOnly"); } set { BackingStore?.Set("isAdultOnly", value); } } /// The isCommercial property - public bool? IsCommercial { + public bool? IsCommercial + { get { return BackingStore?.Get("isCommercial"); } set { BackingStore?.Set("isCommercial", value); } } /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInCreateWriteOnlyChannelRequest() { @@ -46,12 +51,12 @@ public AttributesInCreateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInCreateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, - {"isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, + { "isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs index 6db75b3f12..f9b8d7c8f9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/AttributesInUpdateWriteOnlyChannelRequest.cs @@ -5,39 +5,44 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class AttributesInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable + public class AttributesInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The isAdultOnly property - public bool? IsAdultOnly { + public bool? IsAdultOnly + { get { return BackingStore?.Get("isAdultOnly"); } set { BackingStore?.Set("isAdultOnly", value); } } /// The isCommercial property - public bool? IsCommercial { + public bool? IsCommercial + { get { return BackingStore?.Get("isCommercial"); } set { BackingStore?.Set("isCommercial", value); } } /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public AttributesInUpdateWriteOnlyChannelRequest() { @@ -46,12 +51,12 @@ public AttributesInUpdateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static AttributesInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new AttributesInUpdateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, - {"isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, + { "isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs index da1924151a..a0395f30db 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/CreateWriteOnlyChannelRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class CreateWriteOnlyChannelRequestDocument : IBackedModel, IParsable + public class CreateWriteOnlyChannelRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class CreateWriteOnlyChannelRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInCreateWriteOnlyChannelRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInCreateWriteOnlyChannelRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInCreateWriteOnlyChannelRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInCreateWriteOnlyChannelRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public CreateWriteOnlyChannelRequestDocument() { @@ -36,12 +39,12 @@ public CreateWriteOnlyChannelRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static CreateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new CreateWriteOnlyChannelRequestDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs index a4d0fd8d18..ba50fa9767 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInCreateWriteOnlyChannelRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInCreateWriteOnlyChannelRequest : IBackedModel, IParsable + public class DataInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInCreateWriteOnlyChannelRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInCreateWriteOnlyChannelRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInCreateWriteOnlyChannelRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInCreateWriteOnlyChannelRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,24 +32,27 @@ public AttributesInCreateWriteOnlyChannelRequest Attributes { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInCreateWriteOnlyChannelRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInCreateWriteOnlyChannelRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInCreateWriteOnlyChannelRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInCreateWriteOnlyChannelRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public WriteOnlyChannelResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInCreateWriteOnlyChannelRequest() { @@ -55,12 +61,12 @@ public DataInCreateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInCreateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -70,9 +76,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInCreateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -82,9 +88,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs index cdefa1cd41..88dc4088f9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInResponse : IBackedModel, IParsable + public class DataInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class DataInResponse : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -29,19 +32,21 @@ public string Id { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInResponse() { @@ -50,19 +55,19 @@ public DataInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); return mappingValue switch { - "dataStreams" => new DataStreamDataInResponse(), - "readOnlyChannels" => new ReadOnlyChannelDataInResponse(), - "readOnlyResourceChannels" => new ReadOnlyResourceChannelDataInResponse(), - "writeOnlyChannels" => new WriteOnlyChannelDataInResponse(), - _ => new DataInResponse(), + "dataStreams" => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse(), + "readOnlyChannels" => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse(), + "readOnlyResourceChannels" => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse(), + "writeOnlyChannels" => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse(), }; } /// @@ -73,8 +78,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs index 1b308dee03..18140090e9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInUpdateWriteOnlyChannelRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable + public class DataInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public AttributesInUpdateWriteOnlyChannelRequest? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInUpdateWriteOnlyChannelRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public AttributesInUpdateWriteOnlyChannelRequest Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInUpdateWriteOnlyChannelRequest Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif @@ -29,13 +32,15 @@ public AttributesInUpdateWriteOnlyChannelRequest Attributes { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -43,24 +48,27 @@ public string Id { /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipsInUpdateWriteOnlyChannelRequest? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInUpdateWriteOnlyChannelRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public RelationshipsInUpdateWriteOnlyChannelRequest Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInUpdateWriteOnlyChannelRequest Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// The type property - public WriteOnlyChannelResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataInUpdateWriteOnlyChannelRequest() { @@ -69,12 +77,12 @@ public DataInUpdateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataInUpdateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -84,10 +92,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"attributes", n => { Attributes = n.GetObjectValue(AttributesInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"relationships", n => { Relationships = n.GetObjectValue(RelationshipsInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.AttributesInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -97,10 +105,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("relationships", Relationships); - writer.WriteEnumValue("type", Type); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamAttributesInResponse.cs index 4aeb016dd9..35664ce756 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamAttributesInResponse.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamAttributesInResponse : IBackedModel, IParsable + public class DataStreamAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The bytesTransmitted property - public long? BytesTransmitted { + public long? BytesTransmitted + { get { return BackingStore?.Get("bytesTransmitted"); } set { BackingStore?.Set("bytesTransmitted", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamAttributesInResponse() { @@ -27,12 +29,12 @@ public DataStreamAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse(); } /// /// The deserialization information for the current model @@ -42,7 +44,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"bytesTransmitted", n => { BytesTransmitted = n.GetLongValue(); } }, + { "bytesTransmitted", n => { BytesTransmitted = n.GetLongValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs index 1557239d1c..44e6388a0e 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamCollectionResponseDocument : IBackedModel, IParsable + public class DataStreamCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class DataStreamCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamCollectionResponseDocument() { @@ -78,12 +87,12 @@ public DataStreamCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(DataStreamDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs index 62f9bae76e..4e1315fe10 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public DataStreamCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs index 5ee3f62116..689246d4e2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs @@ -4,62 +4,69 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamDataInResponse : DataInResponse, IParsable + public class DataStreamDataInResponse : OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public DataStreamAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new DataStreamDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamDataInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse(); } /// /// The deserialization information for the current model @@ -69,9 +76,9 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -82,9 +89,9 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs index 7a6abfb204..e54bcd4c8a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamDataInResponse_meta() { @@ -28,12 +30,12 @@ public DataStreamDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs index 9bcb162c60..e5815d100f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamIdentifier : IBackedModel, IParsable + public class DataStreamIdentifier : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,24 +16,27 @@ public class DataStreamIdentifier : IBackedModel, IParsable /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #endif /// The type property - public DataStreamResourceType? Type { - get { return BackingStore?.Get("type"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamResourceType? Type + { + get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamIdentifier() { @@ -41,12 +45,12 @@ public DataStreamIdentifier() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamIdentifier(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier(); } /// /// The deserialization information for the current model @@ -56,8 +60,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"id", n => { Id = n.GetStringValue(); } }, - {"type", n => { Type = n.GetEnumValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, }; } /// @@ -68,7 +72,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteStringValue("id", Id); - writer.WriteEnumValue("type", Type); + writer.WriteEnumValue("type", Type); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs index 37c3e91d5e..cea7edd7bd 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamIdentifierCollectionResponseDocument : IBackedModel, IParsable + public class DataStreamIdentifierCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class DataStreamIdentifierCollectionResponseDocument : IBackedModel, IPar /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifierCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamIdentifierCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamIdentifierCollectionResponseDocument() { @@ -64,12 +71,12 @@ public DataStreamIdentifierCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamIdentifierCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs index 9bb16f760d..ffae42d22a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamIdentifierCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public DataStreamIdentifierCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamIdentifierCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs index 64d3e2744d..4b8f65dbb0 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamIdentifierResponseDocument : IBackedModel, IParsable + public class DataStreamIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class DataStreamIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public DataStreamIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs index 253eec12fa..cfecf2d48b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public DataStreamIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs index da9650298d..19f046ee19 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamPrimaryResponseDocument : IBackedModel, IParsable + public class DataStreamPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class DataStreamPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreams? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreams Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public DataStreamPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreams.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs index 3d353169da..6585cf8283 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public DataStreamPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamResourceType.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamResourceType.cs index 6cea1becd0..c137c282ca 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum DataStreamResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs index 1b6610ae8e..d0df459913 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamSecondaryResponseDocument : IBackedModel, IParsable + public class DataStreamSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class DataStreamSecondaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public VideoStream? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public VideoStream Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public DataStreamSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public DataStreamSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(VideoStream.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs index 1b23567d4f..66810187ae 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class DataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class DataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public DataStreamSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public DataStreamSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static DataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreamSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams.cs deleted file mode 100644 index aa2165261d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class DataStreams : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public DataStreamAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public DataStreamAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public DataStreams_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public DataStreams_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new DataStreams CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreams(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(DataStreams_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams_meta.cs deleted file mode 100644 index 8ede7aae87..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreams_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class DataStreams_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreams_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static DataStreams_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new DataStreams_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorLinks.cs index 0b1163f1b7..8bb6bd0b5d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorLinks.cs @@ -5,21 +5,24 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorLinks : IBackedModel, IParsable + public class ErrorLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// The about property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? About { + public string? About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } #nullable restore #else - public string About { + public string About + { get { return BackingStore?.Get("about"); } set { BackingStore?.Set("about", value); } } @@ -29,19 +32,21 @@ public string About { /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Type { + public string? Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #nullable restore #else - public string Type { + public string Type + { get { return BackingStore?.Get("type"); } set { BackingStore?.Set("type", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorLinks() { @@ -50,12 +55,12 @@ public ErrorLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"about", n => { About = n.GetStringValue(); } }, - {"type", n => { Type = n.GetStringValue(); } }, + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs index 11d1925d61..53b7cb571c 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject : IBackedModel, IParsable + public class ErrorObject : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorObject : IBackedModel, IParsable /// The code property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Code { + public string? Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } #nullable restore #else - public string Code { + public string Code + { get { return BackingStore?.Get("code"); } set { BackingStore?.Set("code", value); } } @@ -29,13 +32,15 @@ public string Code { /// The detail property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Detail { + public string? Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } #nullable restore #else - public string Detail { + public string Detail + { get { return BackingStore?.Get("detail"); } set { BackingStore?.Set("detail", value); } } @@ -43,13 +48,15 @@ public string Detail { /// The id property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Id { + public string? Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } #nullable restore #else - public string Id { + public string Id + { get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } @@ -57,55 +64,63 @@ public string Id { /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorObject_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorObject_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The source property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorSource? Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #nullable restore #else - public ErrorSource Source { - get { return BackingStore?.Get("source"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } set { BackingStore?.Set("source", value); } } #endif /// The status property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Status { + public string? Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } #nullable restore #else - public string Status { + public string Status + { get { return BackingStore?.Get("status"); } set { BackingStore?.Set("status", value); } } @@ -113,19 +128,21 @@ public string Status { /// The title property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Title { + public string? Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #nullable restore #else - public string Title { + public string Title + { get { return BackingStore?.Get("title"); } set { BackingStore?.Set("title", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject() { @@ -134,12 +151,12 @@ public ErrorObject() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject(); } /// /// The deserialization information for the current model @@ -149,14 +166,14 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"code", n => { Code = n.GetStringValue(); } }, - {"detail", n => { Detail = n.GetStringValue(); } }, - {"id", n => { Id = n.GetStringValue(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorObject_meta.CreateFromDiscriminatorValue); } }, - {"source", n => { Source = n.GetObjectValue(ErrorSource.CreateFromDiscriminatorValue); } }, - {"status", n => { Status = n.GetStringValue(); } }, - {"title", n => { Title = n.GetStringValue(); } }, + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, }; } /// @@ -169,9 +186,9 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("code", Code); writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("source", Source); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs index 37b97934f3..f604c56899 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorObject_meta() { @@ -28,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs index 0cdbe22803..ad524a9bf2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs @@ -6,9 +6,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -16,28 +17,32 @@ public class ErrorResponseDocument : ApiException, IBackedModel, IParsable /// The errors property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Errors { - get { return BackingStore?.Get?>("errors"); } + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } set { BackingStore?.Set("errors", value); } } #nullable restore #else - public List Errors { - get { return BackingStore?.Get>("errors"); } + public List Errors + { + get { return BackingStore?.Get>("errors"); } set { BackingStore?.Set("errors", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ErrorTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif @@ -46,19 +51,21 @@ public ErrorTopLevelLinks Links { /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ErrorResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ErrorResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument() { @@ -67,12 +74,12 @@ public ErrorResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument(); } /// /// The deserialization information for the current model @@ -82,9 +89,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"errors", n => { Errors = n.GetCollectionOfObjectValues(ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -94,9 +101,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("errors", Errors); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs index 19e773f235..3c441b928f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorResponseDocument_meta() { @@ -28,12 +30,12 @@ public ErrorResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorSource.cs index 079f38b4a2..6d1d200eed 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorSource.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorSource.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorSource : IBackedModel, IParsable + public class ErrorSource : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorSource : IBackedModel, IParsable /// The header property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Header { + public string? Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } #nullable restore #else - public string Header { + public string Header + { get { return BackingStore?.Get("header"); } set { BackingStore?.Set("header", value); } } @@ -29,13 +32,15 @@ public string Header { /// The parameter property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Parameter { + public string? Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } #nullable restore #else - public string Parameter { + public string Parameter + { get { return BackingStore?.Get("parameter"); } set { BackingStore?.Set("parameter", value); } } @@ -43,19 +48,21 @@ public string Parameter { /// The pointer property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Pointer { + public string? Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #nullable restore #else - public string Pointer { + public string Pointer + { get { return BackingStore?.Get("pointer"); } set { BackingStore?.Set("pointer", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorSource() { @@ -64,12 +71,12 @@ public ErrorSource() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorSource(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"header", n => { Header = n.GetStringValue(); } }, - {"parameter", n => { Parameter = n.GetStringValue(); } }, - {"pointer", n => { Pointer = n.GetStringValue(); } }, + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorTopLevelLinks.cs index 5c2677120a..66dc00688b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ErrorTopLevelLinks : IBackedModel, IParsable + public class ErrorTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ErrorTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ErrorTopLevelLinks() { @@ -50,12 +55,12 @@ public ErrorTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ErrorTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs index 30632bd810..4de66d0786 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableDataStreamIdentifierResponseDocument : IBackedModel, IParsable + public class NullableDataStreamIdentifierResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableDataStreamIdentifierResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceIdentifierTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceIdentifierTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableDataStreamIdentifierResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableDataStreamIdentifierResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableDataStreamIdentifierResponseDocument() { @@ -64,12 +71,12 @@ public NullableDataStreamIdentifierResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableDataStreamIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableDataStreamIdentifierResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableDataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs index 4bcffd0a4f..f816dfc61a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableDataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableDataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableDataStreamIdentifierResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableDataStreamIdentifierResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableDataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableDataStreamIdentifierResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs index 3f1656e7ca..252ab6f830 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableDataStreamSecondaryResponseDocument : IBackedModel, IParsable + public class NullableDataStreamSecondaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class NullableDataStreamSecondaryResponseDocument : IBackedModel, IParsab /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public UltraHighDefinitionVideoStream? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public UltraHighDefinitionVideoStream Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableDataStreamSecondaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableDataStreamSecondaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableDataStreamSecondaryResponseDocument() { @@ -78,12 +87,12 @@ public NullableDataStreamSecondaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableDataStreamSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableDataStreamSecondaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(UltraHighDefinitionVideoStream.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableDataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs index c578a39d8c..c5cb1d8be2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableDataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableDataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableDataStreamSecondaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public NullableDataStreamSecondaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableDataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableDataStreamSecondaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs index 9bf3f8f060..a166580cf6 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneDataStreamInRequest : IBackedModel, IParsable + public class NullableToOneDataStreamInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class NullableToOneDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneDataStreamInRequest() { @@ -36,12 +39,12 @@ public NullableToOneDataStreamInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneDataStreamInRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs index 362d03da12..9c4378d71b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneDataStreamInResponse : IBackedModel, IParsable + public class NullableToOneDataStreamInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class NullableToOneDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public NullableToOneDataStreamInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneDataStreamInResponse() { @@ -64,12 +71,12 @@ public NullableToOneDataStreamInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneDataStreamInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(NullableToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs index ab529f86bc..b1730d4644 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class NullableToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class NullableToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public NullableToOneDataStreamInResponse_meta() { @@ -28,12 +30,12 @@ public NullableToOneDataStreamInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static NullableToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new NullableToOneDataStreamInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelAttributesInResponse.cs index 3d3fc78ef4..6fc248e569 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelAttributesInResponse.cs @@ -5,39 +5,44 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelAttributesInResponse : IBackedModel, IParsable + public class ReadOnlyChannelAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The isAdultOnly property - public bool? IsAdultOnly { + public bool? IsAdultOnly + { get { return BackingStore?.Get("isAdultOnly"); } set { BackingStore?.Set("isAdultOnly", value); } } /// The isCommercial property - public bool? IsCommercial { + public bool? IsCommercial + { get { return BackingStore?.Get("isCommercial"); } set { BackingStore?.Set("isCommercial", value); } } /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelAttributesInResponse() { @@ -46,12 +51,12 @@ public ReadOnlyChannelAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, - {"isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, + { "isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs index f81496954f..e1c2588804 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelCollectionResponseDocument : IBackedModel, IParsable + public class ReadOnlyChannelCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ReadOnlyChannelCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannelCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyChannelCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelCollectionResponseDocument() { @@ -78,12 +87,12 @@ public ReadOnlyChannelCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ReadOnlyChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs index 388374bbb6..00d8b83033 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public ReadOnlyChannelCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs index 3928c30957..b94e8c407d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelDataInResponse : DataInResponse, IParsable + public class ReadOnlyChannelDataInResponse : OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public ReadOnlyChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannelDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyChannelDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public ReadOnlyChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new ReadOnlyChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelDataInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(ReadOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(ReadOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs index 70e98b7fd0..075b94a930 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelDataInResponse_meta() { @@ -28,12 +30,12 @@ public ReadOnlyChannelDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs index 46e740520a..eb7cce735a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable + public class ReadOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ReadOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannels? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public ReadOnlyChannels Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyChannelPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyChannelPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public ReadOnlyChannelPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(ReadOnlyChannels.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs index 68c36af806..9f7f32c4c6 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public ReadOnlyChannelPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelRelationshipsInResponse.cs index 33e0825698..88444f96d2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyChannelRelationshipsInResponse : IBackedModel, IParsable + public class ReadOnlyChannelRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInResponse? AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse? AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #nullable restore #else - public ToManyDataStreamInResponse AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #endif @@ -29,33 +32,37 @@ public ToManyDataStreamInResponse AudioStreams { /// The ultraHighDefinitionVideoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #nullable restore #else - public NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #endif /// The videoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInResponse? VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse? VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #nullable restore #else - public ToOneDataStreamInResponse VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyChannelRelationshipsInResponse() { @@ -64,12 +71,12 @@ public ReadOnlyChannelRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannelRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"audioStreams", n => { AudioStreams = n.GetObjectValue(ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"videoStream", n => { VideoStream = n.GetObjectValue(ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "audioStreams", n => { AudioStreams = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "videoStream", n => { VideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("audioStreams", AudioStreams); - writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); - writer.WriteObjectValue("videoStream", VideoStream); + writer.WriteObjectValue("audioStreams", AudioStreams); + writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); + writer.WriteObjectValue("videoStream", VideoStream); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels.cs deleted file mode 100644 index 9ec433df51..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class ReadOnlyChannels : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public ReadOnlyChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyChannels_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public ReadOnlyChannels_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public ReadOnlyChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new ReadOnlyChannels CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannels(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(ReadOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyChannels_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(ReadOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels_meta.cs deleted file mode 100644 index 9ef5bfee1a..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannels_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class ReadOnlyChannels_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyChannels_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyChannels_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyChannels_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelAttributesInResponse.cs index 60aa7cf290..5f379982d6 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelAttributesInResponse.cs @@ -5,39 +5,44 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelAttributesInResponse : IBackedModel, IParsable + public class ReadOnlyResourceChannelAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The isAdultOnly property - public bool? IsAdultOnly { + public bool? IsAdultOnly + { get { return BackingStore?.Get("isAdultOnly"); } set { BackingStore?.Set("isAdultOnly", value); } } /// The isCommercial property - public bool? IsCommercial { + public bool? IsCommercial + { get { return BackingStore?.Get("isCommercial"); } set { BackingStore?.Set("isCommercial", value); } } /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelAttributesInResponse() { @@ -46,12 +51,12 @@ public ReadOnlyResourceChannelAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, - {"isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, + { "isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs index 6f50b54a10..4cea8215ba 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelCollectionResponseDocument : IBackedModel, IParsable + public class ReadOnlyResourceChannelCollectionResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ReadOnlyResourceChannelCollectionResponseDocument : IBackedModel, I /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceCollectionTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceCollectionTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannelCollectionResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyResourceChannelCollectionResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelCollectionResponseDocument() { @@ -78,12 +87,12 @@ public ReadOnlyResourceChannelCollectionResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelCollectionResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(ReadOnlyResourceChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyResourceChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs index 02cbc47f1c..0f55bc910d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyResourceChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelCollectionResponseDocument_meta() { @@ -28,12 +30,12 @@ public ReadOnlyResourceChannelCollectionResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelCollectionResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs index 910a828046..c278405ce3 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelDataInResponse : DataInResponse, IParsable + public class ReadOnlyResourceChannelDataInResponse : OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public ReadOnlyResourceChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannelDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyResourceChannelDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public ReadOnlyResourceChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new ReadOnlyResourceChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelDataInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(ReadOnlyResourceChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyResourceChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(ReadOnlyResourceChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs index cd41c3929a..418cc2b9c9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyResourceChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelDataInResponse_meta() { @@ -28,12 +30,12 @@ public ReadOnlyResourceChannelDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs index 96db32fec8..f294b2c04d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelPrimaryResponseDocument : IBackedModel, IParsable + public class ReadOnlyResourceChannelPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class ReadOnlyResourceChannelPrimaryResponseDocument : IBackedModel, IPar /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannels? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public ReadOnlyResourceChannels Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ReadOnlyResourceChannelPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ReadOnlyResourceChannelPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public ReadOnlyResourceChannelPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(ReadOnlyResourceChannels.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyResourceChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs index dce9209c53..360660af73 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ReadOnlyResourceChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public ReadOnlyResourceChannelPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelRelationshipsInResponse.cs index ef79b1003d..bdcc08f28f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ReadOnlyResourceChannelRelationshipsInResponse : IBackedModel, IParsable + public class ReadOnlyResourceChannelRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInResponse? AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse? AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #nullable restore #else - public ToManyDataStreamInResponse AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #endif @@ -29,33 +32,37 @@ public ToManyDataStreamInResponse AudioStreams { /// The ultraHighDefinitionVideoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #nullable restore #else - public NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #endif /// The videoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInResponse? VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse? VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #nullable restore #else - public ToOneDataStreamInResponse VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ReadOnlyResourceChannelRelationshipsInResponse() { @@ -64,12 +71,12 @@ public ReadOnlyResourceChannelRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannelRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"audioStreams", n => { AudioStreams = n.GetObjectValue(ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"videoStream", n => { VideoStream = n.GetObjectValue(ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "audioStreams", n => { AudioStreams = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "videoStream", n => { VideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("audioStreams", AudioStreams); - writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); - writer.WriteObjectValue("videoStream", VideoStream); + writer.WriteObjectValue("audioStreams", AudioStreams); + writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); + writer.WriteObjectValue("videoStream", VideoStream); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels.cs deleted file mode 100644 index df3c8a7a47..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class ReadOnlyResourceChannels : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyResourceChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public ReadOnlyResourceChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyResourceChannels_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public ReadOnlyResourceChannels_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ReadOnlyResourceChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public ReadOnlyResourceChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new ReadOnlyResourceChannels CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannels(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(ReadOnlyResourceChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ReadOnlyResourceChannels_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(ReadOnlyResourceChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels_meta.cs deleted file mode 100644 index f065783b93..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannels_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class ReadOnlyResourceChannels_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyResourceChannels_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static ReadOnlyResourceChannels_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ReadOnlyResourceChannels_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipLinks.cs index 473e203a82..ff527605d8 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipLinks : IBackedModel, IParsable + public class RelationshipLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class RelationshipLinks : IBackedModel, IParsable /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -29,19 +32,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipLinks() { @@ -50,12 +55,12 @@ public RelationshipLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs index d98f215d15..523a1bd2a9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInCreateWriteOnlyChannelRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInCreateWriteOnlyChannelRequest : IBackedModel, IParsable + public class RelationshipsInCreateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInRequest? AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest? AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #nullable restore #else - public ToManyDataStreamInRequest AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #endif @@ -29,33 +32,37 @@ public ToManyDataStreamInRequest AudioStreams { /// The ultraHighDefinitionVideoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInRequest? UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest? UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #nullable restore #else - public NullableToOneDataStreamInRequest UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #endif /// The videoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInRequest? VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest? VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #nullable restore #else - public ToOneDataStreamInRequest VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInCreateWriteOnlyChannelRequest() { @@ -64,12 +71,12 @@ public RelationshipsInCreateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInCreateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInCreateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInCreateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"audioStreams", n => { AudioStreams = n.GetObjectValue(ToManyDataStreamInRequest.CreateFromDiscriminatorValue); } }, - {"ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(NullableToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, - {"videoStream", n => { VideoStream = n.GetObjectValue(ToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "audioStreams", n => { AudioStreams = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "videoStream", n => { VideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("audioStreams", AudioStreams); - writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); - writer.WriteObjectValue("videoStream", VideoStream); + writer.WriteObjectValue("audioStreams", AudioStreams); + writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); + writer.WriteObjectValue("videoStream", VideoStream); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs index b778c0881a..ff1ca0a1d8 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/RelationshipsInUpdateWriteOnlyChannelRequest.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class RelationshipsInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable + public class RelationshipsInUpdateWriteOnlyChannelRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInRequest? AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest? AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #nullable restore #else - public ToManyDataStreamInRequest AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #endif @@ -29,33 +32,37 @@ public ToManyDataStreamInRequest AudioStreams { /// The ultraHighDefinitionVideoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInRequest? UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest? UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #nullable restore #else - public NullableToOneDataStreamInRequest UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #endif /// The videoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInRequest? VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest? VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #nullable restore #else - public ToOneDataStreamInRequest VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public RelationshipsInUpdateWriteOnlyChannelRequest() { @@ -64,12 +71,12 @@ public RelationshipsInUpdateWriteOnlyChannelRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static RelationshipsInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInUpdateWriteOnlyChannelRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new RelationshipsInUpdateWriteOnlyChannelRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipsInUpdateWriteOnlyChannelRequest(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"audioStreams", n => { AudioStreams = n.GetObjectValue(ToManyDataStreamInRequest.CreateFromDiscriminatorValue); } }, - {"ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(NullableToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, - {"videoStream", n => { VideoStream = n.GetObjectValue(ToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "audioStreams", n => { AudioStreams = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, + { "videoStream", n => { VideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("audioStreams", AudioStreams); - writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); - writer.WriteObjectValue("videoStream", VideoStream); + writer.WriteObjectValue("audioStreams", AudioStreams); + writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); + writer.WriteObjectValue("videoStream", VideoStream); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs index b403d24733..4a468a4153 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,19 +96,21 @@ public string Prev { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceCollectionTopLevelLinks() { @@ -106,12 +119,12 @@ public ResourceCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -121,12 +134,12 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs index 53d765c821..b07cb17770 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The first property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? First { + public string? First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } #nullable restore #else - public string First { + public string First + { get { return BackingStore?.Get("first"); } set { BackingStore?.Set("first", value); } } @@ -43,13 +48,15 @@ public string First { /// The last property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Last { + public string? Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } #nullable restore #else - public string Last { + public string Last + { get { return BackingStore?.Get("last"); } set { BackingStore?.Set("last", value); } } @@ -57,13 +64,15 @@ public string Last { /// The next property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Next { + public string? Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } #nullable restore #else - public string Next { + public string Next + { get { return BackingStore?.Get("next"); } set { BackingStore?.Set("next", value); } } @@ -71,13 +80,15 @@ public string Next { /// The prev property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Prev { + public string? Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } #nullable restore #else - public string Prev { + public string Prev + { get { return BackingStore?.Get("prev"); } set { BackingStore?.Set("prev", value); } } @@ -85,13 +96,15 @@ public string Prev { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -99,19 +112,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierCollectionTopLevelLinks() { @@ -120,12 +135,12 @@ public ResourceIdentifierCollectionTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierCollectionTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); } /// /// The deserialization information for the current model @@ -135,13 +150,13 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"first", n => { First = n.GetStringValue(); } }, - {"last", n => { Last = n.GetStringValue(); } }, - {"next", n => { Next = n.GetStringValue(); } }, - {"prev", n => { Prev = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs index a2997c5e3c..c44bbb9b98 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable + public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,13 +32,15 @@ public string Describedby { /// The related property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Related { + public string? Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } #nullable restore #else - public string Related { + public string Related + { get { return BackingStore?.Get("related"); } set { BackingStore?.Set("related", value); } } @@ -43,19 +48,21 @@ public string Related { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceIdentifierTopLevelLinks() { @@ -64,12 +71,12 @@ public ResourceIdentifierTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceIdentifierTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"related", n => { Related = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceLinks.cs index 5dc3d3dd3f..06325eff74 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceLinks : IBackedModel, IParsable + public class ResourceLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ResourceLinks : IBackedModel, IParsable /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceLinks() { @@ -36,12 +39,12 @@ public ResourceLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"self", n => { Self = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceTopLevelLinks.cs index 07e0040e1c..837b0bc060 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceTopLevelLinks.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ResourceTopLevelLinks : IBackedModel, IParsable + public class ResourceTopLevelLinks : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,13 +16,15 @@ public class ResourceTopLevelLinks : IBackedModel, IParsable /// The describedby property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Describedby { + public string? Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } #nullable restore #else - public string Describedby { + public string Describedby + { get { return BackingStore?.Get("describedby"); } set { BackingStore?.Set("describedby", value); } } @@ -29,19 +32,21 @@ public string Describedby { /// The self property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Self { + public string? Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #nullable restore #else - public string Self { + public string Self + { get { return BackingStore?.Get("self"); } set { BackingStore?.Set("self", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ResourceTopLevelLinks() { @@ -50,12 +55,12 @@ public ResourceTopLevelLinks() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ResourceTopLevelLinks(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks(); } /// /// The deserialization information for the current model @@ -65,8 +70,8 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"describedby", n => { Describedby = n.GetStringValue(); } }, - {"self", n => { Self = n.GetStringValue(); } }, + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs index 8bcec2aaf3..4b01a045a4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyDataStreamInRequest : IBackedModel, IParsable + public class ToManyDataStreamInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToManyDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyDataStreamInRequest() { @@ -36,12 +39,12 @@ public ToManyDataStreamInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyDataStreamInRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs index 0db707d474..c9e5da9a23 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyDataStreamInResponse : IBackedModel, IParsable + public class ToManyDataStreamInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToManyDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data { - get { return BackingStore?.Get?>("data"); } + public List? Data + { + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data { - get { return BackingStore?.Get>("data"); } + public List Data + { + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToManyDataStreamInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyDataStreamInResponse() { @@ -64,12 +71,12 @@ public ToManyDataStreamInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyDataStreamInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetCollectionOfObjectValues(DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToManyDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs index e65b039115..bef21bff25 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToManyDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToManyDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToManyDataStreamInResponse_meta() { @@ -28,12 +30,12 @@ public ToManyDataStreamInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToManyDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToManyDataStreamInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs index 9300406be3..165fd9950a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneDataStreamInRequest : IBackedModel, IParsable + public class ToOneDataStreamInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class ToOneDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneDataStreamInRequest() { @@ -36,12 +39,12 @@ public ToOneDataStreamInRequest() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneDataStreamInRequest(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs index ba25267ca5..5d14a7c8a4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneDataStreamInResponse : IBackedModel, IParsable + public class ToOneDataStreamInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,47 +16,53 @@ public class ToOneDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataStreamIdentifier? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataStreamIdentifier Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RelationshipLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public RelationshipLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public ToOneDataStreamInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneDataStreamInResponse() { @@ -64,12 +71,12 @@ public ToOneDataStreamInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneDataStreamInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataStreamIdentifier.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(RelationshipLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(ToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs index 3772386b8e..e54a9497a5 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class ToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class ToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public ToOneDataStreamInResponse_meta() { @@ -28,12 +30,12 @@ public ToOneDataStreamInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static ToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new ToOneDataStreamInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream.cs deleted file mode 100644 index deef70dce4..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class UltraHighDefinitionVideoStream : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public DataStreamAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public DataStreamAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public UltraHighDefinitionVideoStream_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public UltraHighDefinitionVideoStream_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new UltraHighDefinitionVideoStream CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UltraHighDefinitionVideoStream(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(UltraHighDefinitionVideoStream_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream_meta.cs deleted file mode 100644 index 40316e6be9..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UltraHighDefinitionVideoStream_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class UltraHighDefinitionVideoStream_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public UltraHighDefinitionVideoStream_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static UltraHighDefinitionVideoStream_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UltraHighDefinitionVideoStream_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs index 43e5596cc9..71e07786c4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/UpdateWriteOnlyChannelRequestDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class UpdateWriteOnlyChannelRequestDocument : IBackedModel, IParsable + public class UpdateWriteOnlyChannelRequestDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,19 +16,21 @@ public class UpdateWriteOnlyChannelRequestDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public DataInUpdateWriteOnlyChannelRequest? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInUpdateWriteOnlyChannelRequest? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public DataInUpdateWriteOnlyChannelRequest Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInUpdateWriteOnlyChannelRequest Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public UpdateWriteOnlyChannelRequestDocument() { @@ -36,12 +39,12 @@ public UpdateWriteOnlyChannelRequestDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static UpdateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new UpdateWriteOnlyChannelRequestDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument(); } /// /// The deserialization information for the current model @@ -51,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(DataInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInUpdateWriteOnlyChannelRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -61,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream.cs deleted file mode 100644 index 06cbc45131..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class VideoStream : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public DataStreamAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public DataStreamAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public VideoStream_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public VideoStream_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new VideoStream CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VideoStream(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(VideoStream_meta.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream_meta.cs deleted file mode 100644 index 298fc045bb..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/VideoStream_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class VideoStream_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public VideoStream_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static VideoStream_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new VideoStream_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInResponse.cs index 459a4f2506..2be56b0111 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelAttributesInResponse.cs @@ -5,39 +5,44 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelAttributesInResponse : IBackedModel, IParsable + public class WriteOnlyChannelAttributesInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. public IBackingStore BackingStore { get; private set; } /// The isAdultOnly property - public bool? IsAdultOnly { + public bool? IsAdultOnly + { get { return BackingStore?.Get("isAdultOnly"); } set { BackingStore?.Set("isAdultOnly", value); } } /// The isCommercial property - public bool? IsCommercial { + public bool? IsCommercial + { get { return BackingStore?.Get("isCommercial"); } set { BackingStore?.Set("isCommercial", value); } } /// The name property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public string? Name { + public string? Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #nullable restore #else - public string Name { + public string Name + { get { return BackingStore?.Get("name"); } set { BackingStore?.Set("name", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public WriteOnlyChannelAttributesInResponse() { @@ -46,12 +51,12 @@ public WriteOnlyChannelAttributesInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelAttributesInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse(); } /// /// The deserialization information for the current model @@ -61,9 +66,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, - {"isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, - {"name", n => { Name = n.GetStringValue(); } }, + { "isAdultOnly", n => { IsAdultOnly = n.GetBoolValue(); } }, + { "isCommercial", n => { IsCommercial = n.GetBoolValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, }; } /// diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs index 2415e3cfec..1ec9532116 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs @@ -4,76 +4,85 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelDataInResponse : DataInResponse, IParsable + public class WriteOnlyChannelDataInResponse : OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse, IParsable #pragma warning restore CS1591 { /// The attributes property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #nullable restore #else - public WriteOnlyChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelDataInResponse_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public WriteOnlyChannelDataInResponse_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #nullable restore #else - public WriteOnlyChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } set { BackingStore?.Set("relationships", value); } } #endif /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static new WriteOnlyChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelDataInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse(); } /// /// The deserialization information for the current model @@ -83,10 +92,10 @@ public override IDictionary> GetFieldDeserializers() { return new Dictionary>(base.GetFieldDeserializers()) { - {"attributes", n => { Attributes = n.GetObjectValue(WriteOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(WriteOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(WriteOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -97,10 +106,10 @@ public override void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs index 18a212a6e0..fbce1ee2f3 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class WriteOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public WriteOnlyChannelDataInResponse_meta() { @@ -28,12 +30,12 @@ public WriteOnlyChannelDataInResponse_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelDataInResponse_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs index e848e3dfc0..c0bcc35a79 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs @@ -5,9 +5,10 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable + public class WriteOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -15,61 +16,69 @@ public class WriteOnlyChannelPrimaryResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannels? Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse? Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public WriteOnlyChannels Data { - get { return BackingStore?.Get("data"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse Data + { + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif /// The included property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Included { - get { return BackingStore?.Get?>("included"); } + public List? Included + { + get { return BackingStore?.Get?>("included"); } set { BackingStore?.Set("included", value); } } #nullable restore #else - public List Included { - get { return BackingStore?.Get>("included"); } + public List Included + { + get { return BackingStore?.Get>("included"); } set { BackingStore?.Set("included", value); } } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ResourceTopLevelLinks? Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #nullable restore #else - public ResourceTopLevelLinks Links { - get { return BackingStore?.Get("links"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } set { BackingStore?.Set("links", value); } } #endif /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public WriteOnlyChannelPrimaryResponseDocument_meta? Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta? Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public WriteOnlyChannelPrimaryResponseDocument_meta Meta { - get { return BackingStore?.Get("meta"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta Meta + { + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public WriteOnlyChannelPrimaryResponseDocument() { @@ -78,12 +87,12 @@ public WriteOnlyChannelPrimaryResponseDocument() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelPrimaryResponseDocument(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument(); } /// /// The deserialization information for the current model @@ -93,10 +102,10 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"data", n => { Data = n.GetObjectValue(WriteOnlyChannels.CreateFromDiscriminatorValue); } }, - {"included", n => { Included = n.GetCollectionOfObjectValues(DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, - {"links", n => { Links = n.GetObjectValue(ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(WriteOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -106,10 +115,10 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); - writer.WriteCollectionOfObjectValues("included", Included); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs index 5a4a05fe6c..3301d96b9c 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs @@ -5,20 +5,22 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class WriteOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } set { BackingStore.Set("AdditionalData", value); } } /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public WriteOnlyChannelPrimaryResponseDocument_meta() { @@ -28,12 +30,12 @@ public WriteOnlyChannelPrimaryResponseDocument_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelPrimaryResponseDocument_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInResponse.cs index aff248d36b..fd0591f570 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelRelationshipsInResponse.cs @@ -5,22 +5,25 @@ using System.IO; using System.Linq; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 - public class WriteOnlyChannelRelationshipsInResponse : IBackedModel, IParsable + public class WriteOnlyChannelRelationshipsInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// The audioStreams property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToManyDataStreamInResponse? AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse? AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #nullable restore #else - public ToManyDataStreamInResponse AudioStreams { - get { return BackingStore?.Get("audioStreams"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse AudioStreams + { + get { return BackingStore?.Get("audioStreams"); } set { BackingStore?.Set("audioStreams", value); } } #endif @@ -29,33 +32,37 @@ public ToManyDataStreamInResponse AudioStreams { /// The ultraHighDefinitionVideoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse? UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #nullable restore #else - public NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream { - get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse UltraHighDefinitionVideoStream + { + get { return BackingStore?.Get("ultraHighDefinitionVideoStream"); } set { BackingStore?.Set("ultraHighDefinitionVideoStream", value); } } #endif /// The videoStream property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public ToOneDataStreamInResponse? VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse? VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #nullable restore #else - public ToOneDataStreamInResponse VideoStream { - get { return BackingStore?.Get("videoStream"); } + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse VideoStream + { + get { return BackingStore?.Get("videoStream"); } set { BackingStore?.Set("videoStream", value); } } #endif /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// public WriteOnlyChannelRelationshipsInResponse() { @@ -64,12 +71,12 @@ public WriteOnlyChannelRelationshipsInResponse() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannelRelationshipsInResponse(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse(); } /// /// The deserialization information for the current model @@ -79,9 +86,9 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - {"audioStreams", n => { AudioStreams = n.GetObjectValue(ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, - {"videoStream", n => { VideoStream = n.GetObjectValue(ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "audioStreams", n => { AudioStreams = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "ultraHighDefinitionVideoStream", n => { UltraHighDefinitionVideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, + { "videoStream", n => { VideoStream = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,9 +98,9 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("audioStreams", AudioStreams); - writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); - writer.WriteObjectValue("videoStream", VideoStream); + writer.WriteObjectValue("audioStreams", AudioStreams); + writer.WriteObjectValue("ultraHighDefinitionVideoStream", UltraHighDefinitionVideoStream); + writer.WriteObjectValue("videoStream", VideoStream); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelResourceType.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelResourceType.cs index 4090f23d51..cc45102730 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelResourceType.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelResourceType.cs @@ -1,7 +1,8 @@ // using System.Runtime.Serialization; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ #pragma warning disable CS1591 public enum WriteOnlyChannelResourceType #pragma warning restore CS1591 diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels.cs deleted file mode 100644 index 116949966d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class WriteOnlyChannels : DataInResponse, IParsable - #pragma warning restore CS1591 - { - /// The attributes property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public WriteOnlyChannelAttributesInResponse? Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#nullable restore -#else - public WriteOnlyChannelAttributesInResponse Attributes { - get { return BackingStore?.Get("attributes"); } - set { BackingStore?.Set("attributes", value); } - } -#endif - /// The links property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public ResourceLinks? Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#nullable restore -#else - public ResourceLinks Links { - get { return BackingStore?.Get("links"); } - set { BackingStore?.Set("links", value); } - } -#endif - /// The meta property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public WriteOnlyChannels_meta? Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#nullable restore -#else - public WriteOnlyChannels_meta Meta { - get { return BackingStore?.Get("meta"); } - set { BackingStore?.Set("meta", value); } - } -#endif - /// The relationships property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public WriteOnlyChannelRelationshipsInResponse? Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#nullable restore -#else - public WriteOnlyChannelRelationshipsInResponse Relationships { - get { return BackingStore?.Get("relationships"); } - set { BackingStore?.Set("relationships", value); } - } -#endif - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static new WriteOnlyChannels CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannels(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public override IDictionary> GetFieldDeserializers() - { - return new Dictionary>(base.GetFieldDeserializers()) - { - {"attributes", n => { Attributes = n.GetObjectValue(WriteOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, - {"links", n => { Links = n.GetObjectValue(ResourceLinks.CreateFromDiscriminatorValue); } }, - {"meta", n => { Meta = n.GetObjectValue(WriteOnlyChannels_meta.CreateFromDiscriminatorValue); } }, - {"relationships", n => { Relationships = n.GetObjectValue(WriteOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public override void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - base.Serialize(writer); - writer.WriteObjectValue("attributes", Attributes); - writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); - writer.WriteObjectValue("relationships", Relationships); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels_meta.cs deleted file mode 100644 index 4fc90ea8fb..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannels_meta.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { - #pragma warning disable CS1591 - public class WriteOnlyChannels_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData { - get { return BackingStore.Get>("AdditionalData") ?? throw new InvalidOperationException("AdditionalData can not be null"); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public WriteOnlyChannels_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static WriteOnlyChannels_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new WriteOnlyChannels_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs index c2a8e3d5e2..2162f6dffa 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\audioStreams /// - public class AudioStreamsRequestBuilder : BaseRequestBuilder + public class AudioStreamsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AudioStreamsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AudioStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStreams of an individual readOnlyChannel's audioStreams relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AudioStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams.AudioStreamsRequestBuilder WithUrl(string rawUrl) { - return new AudioStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams.AudioStreamsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStreams of an individual readOnlyChannel's audioStreams relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/ReadOnlyChannelsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/ReadOnlyChannelsItemRequestBuilder.cs index ea9250bd78..4c21cfff2f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/ReadOnlyChannelsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/ReadOnlyChannelsItemRequestBuilder.cs @@ -12,34 +12,35 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id} /// - public class ReadOnlyChannelsItemRequestBuilder : BaseRequestBuilder + public class ReadOnlyChannelsItemRequestBuilder : BaseRequestBuilder { /// The audioStreams property - public AudioStreamsRequestBuilder AudioStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams.AudioStreamsRequestBuilder AudioStreams { - get => new AudioStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.AudioStreams.AudioStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// The ultraHighDefinitionVideoStream property - public UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream { - get => new UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// The videoStream property - public VideoStreamRequestBuilder VideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream.VideoStreamRequestBuilder VideoStream { - get => new VideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream.VideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -47,7 +48,7 @@ public ReadOnlyChannelsItemRequestBuilder(Dictionary pathParamet { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -57,27 +58,27 @@ public ReadOnlyChannelsItemRequestBuilder(string rawUrl, IRequestAdapter request /// /// Retrieves an individual readOnlyChannel by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ReadOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -86,11 +87,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -103,11 +104,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -122,11 +123,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -136,11 +137,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ReadOnlyChannelsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.ReadOnlyChannelsItemRequestBuilder WithUrl(string rawUrl) { - return new ReadOnlyChannelsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.ReadOnlyChannelsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual readOnlyChannel by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs index ef9434294b..ce095f57e7 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\relationships\audioStreams /// - public class AudioStreamsRequestBuilder : BaseRequestBuilder + public class AudioStreamsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AudioStreamsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AudioStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStream identities of an individual readOnlyChannel's audioStreams relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(Actio /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AudioStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder WithUrl(string rawUrl) { - return new AudioStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identities of an individual readOnlyChannel's audioStreams relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs index 7490764bb5..ea8f558cc9 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The audioStreams property - public AudioStreamsRequestBuilder AudioStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder AudioStreams { - get => new AudioStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The ultraHighDefinitionVideoStream property - public UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream { - get => new UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// The videoStream property - public VideoStreamRequestBuilder VideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder VideoStream { - get => new VideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs index 2ccd38ef05..83390f5bbb 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\relationships\ultraHighDefinitionVideoStream /// - public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder + public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public UltraHighDefinitionVideoStreamRequestBuilder(Dictionary p { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public UltraHighDefinitionVideoStreamRequestBuilder(string rawUrl, IRequestAdapt /// /// Retrieves the related dataStream identity of an individual readOnlyChannel's ultraHighDefinitionVideoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableDataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) { - return new UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identity of an individual readOnlyChannel's ultraHighDefinitionVideoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs index ad30a14547..5c886b1f5f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\relationships\videoStream /// - public class VideoStreamRequestBuilder : BaseRequestBuilder + public class VideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public VideoStreamRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public VideoStreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStream identity of an individual readOnlyChannel's videoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder WithUrl(string rawUrl) { - return new VideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identity of an individual readOnlyChannel's videoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs index a3dafa7b64..c794c00b5b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\ultraHighDefinitionVideoStream /// - public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder + public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public UltraHighDefinitionVideoStreamRequestBuilder(Dictionary p { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public UltraHighDefinitionVideoStreamRequestBuilder(string rawUrl, IRequestAdapt /// /// Retrieves the related dataStream of an individual readOnlyChannel's ultraHighDefinitionVideoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableDataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) { - return new UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream of an individual readOnlyChannel's ultraHighDefinitionVideoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/VideoStream/VideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/VideoStream/VideoStreamRequestBuilder.cs index 075abd814e..09869630ef 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/VideoStream/VideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/Item/VideoStream/VideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream +{ /// /// Builds and executes requests for operations under \readOnlyChannels\{id}\videoStream /// - public class VideoStreamRequestBuilder : BaseRequestBuilder + public class VideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public VideoStreamRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public VideoStreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStream of an individual readOnlyChannel's videoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream.VideoStreamRequestBuilder WithUrl(string rawUrl) { - return new VideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.VideoStream.VideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream of an individual readOnlyChannel's videoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/ReadOnlyChannelsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/ReadOnlyChannelsRequestBuilder.cs index e3c48dd60e..b64a35499a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/ReadOnlyChannelsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyChannels/ReadOnlyChannelsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels +{ /// /// Builds and executes requests for operations under \readOnlyChannels /// - public class ReadOnlyChannelsRequestBuilder : BaseRequestBuilder + public class ReadOnlyChannelsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.readOnlyChannels.item collection /// The identifier of the readOnlyChannel to retrieve. - /// A - public ReadOnlyChannelsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.ReadOnlyChannelsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new ReadOnlyChannelsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.Item.ReadOnlyChannelsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public ReadOnlyChannelsRequestBuilder(Dictionary pathParameters, { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public ReadOnlyChannelsRequestBuilder(string rawUrl, IRequestAdapter requestAdap /// /// Retrieves a collection of readOnlyChannels. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ReadOnlyChannelCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -90,11 +91,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -109,11 +110,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -123,11 +124,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ReadOnlyChannelsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.ReadOnlyChannelsRequestBuilder WithUrl(string rawUrl) { - return new ReadOnlyChannelsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.ReadOnlyChannelsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of readOnlyChannels. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs index 5053e6244c..43133f89f0 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/AudioStreams/AudioStreamsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams +{ /// /// Builds and executes requests for operations under \readOnlyResourceChannels\{id}\audioStreams /// - public class AudioStreamsRequestBuilder : BaseRequestBuilder + public class AudioStreamsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AudioStreamsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public AudioStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStreams of an individual readOnlyResourceChannel's audioStreams relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AudioStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams.AudioStreamsRequestBuilder WithUrl(string rawUrl) { - return new AudioStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams.AudioStreamsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStreams of an individual readOnlyResourceChannel's audioStreams relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/ReadOnlyResourceChannelsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/ReadOnlyResourceChannelsItemRequestBuilder.cs index 9fdcf09e05..4382a8c33e 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/ReadOnlyResourceChannelsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/ReadOnlyResourceChannelsItemRequestBuilder.cs @@ -11,29 +11,30 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item +{ /// /// Builds and executes requests for operations under \readOnlyResourceChannels\{id} /// - public class ReadOnlyResourceChannelsItemRequestBuilder : BaseRequestBuilder + public class ReadOnlyResourceChannelsItemRequestBuilder : BaseRequestBuilder { /// The audioStreams property - public AudioStreamsRequestBuilder AudioStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams.AudioStreamsRequestBuilder AudioStreams { - get => new AudioStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.AudioStreams.AudioStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The ultraHighDefinitionVideoStream property - public UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream { - get => new UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// The videoStream property - public VideoStreamRequestBuilder VideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream.VideoStreamRequestBuilder VideoStream { - get => new VideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream.VideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -41,7 +42,7 @@ public ReadOnlyResourceChannelsItemRequestBuilder(Dictionary pat { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -51,27 +52,27 @@ public ReadOnlyResourceChannelsItemRequestBuilder(string rawUrl, IRequestAdapter /// /// Retrieves an individual readOnlyResourceChannel by its identifier. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ReadOnlyResourceChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -80,11 +81,11 @@ public async Task GetAsync(Actio /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -97,11 +98,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -116,11 +117,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -130,11 +131,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ReadOnlyResourceChannelsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.ReadOnlyResourceChannelsItemRequestBuilder WithUrl(string rawUrl) { - return new ReadOnlyResourceChannelsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.ReadOnlyResourceChannelsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves an individual readOnlyResourceChannel by its identifier. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs index 080a6495db..26c6e9ec77 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream +{ /// /// Builds and executes requests for operations under \readOnlyResourceChannels\{id}\ultraHighDefinitionVideoStream /// - public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder + public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public UltraHighDefinitionVideoStreamRequestBuilder(Dictionary p { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public UltraHighDefinitionVideoStreamRequestBuilder(string rawUrl, IRequestAdapt /// /// Retrieves the related dataStream of an individual readOnlyResourceChannel's ultraHighDefinitionVideoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableDataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) { - return new UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream of an individual readOnlyResourceChannel's ultraHighDefinitionVideoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/VideoStream/VideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/VideoStream/VideoStreamRequestBuilder.cs index 8b0db881a6..7b7a61fc5d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/VideoStream/VideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/Item/VideoStream/VideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream +{ /// /// Builds and executes requests for operations under \readOnlyResourceChannels\{id}\videoStream /// - public class VideoStreamRequestBuilder : BaseRequestBuilder + public class VideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public VideoStreamRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public VideoStreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStream of an individual readOnlyResourceChannel's videoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -79,11 +80,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -98,11 +99,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -112,11 +113,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream.VideoStreamRequestBuilder WithUrl(string rawUrl) { - return new VideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.VideoStream.VideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream of an individual readOnlyResourceChannel's videoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/ReadOnlyResourceChannelsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/ReadOnlyResourceChannelsRequestBuilder.cs index b6eb434a2e..dd2dfd2cac 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/ReadOnlyResourceChannelsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/ReadOnlyResourceChannels/ReadOnlyResourceChannelsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels +{ /// /// Builds and executes requests for operations under \readOnlyResourceChannels /// - public class ReadOnlyResourceChannelsRequestBuilder : BaseRequestBuilder + public class ReadOnlyResourceChannelsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.readOnlyResourceChannels.item collection /// The identifier of the readOnlyResourceChannel to retrieve. - /// A - public ReadOnlyResourceChannelsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.ReadOnlyResourceChannelsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new ReadOnlyResourceChannelsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.Item.ReadOnlyResourceChannelsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public ReadOnlyResourceChannelsRequestBuilder(Dictionary pathPar { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,25 +47,25 @@ public ReadOnlyResourceChannelsRequestBuilder(string rawUrl, IRequestAdapter req /// /// Retrieves a collection of readOnlyResourceChannels. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code + /// When receiving a 400 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, ReadOnlyResourceChannelCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -73,11 +74,11 @@ public async Task GetAsync(Ac /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -90,11 +91,11 @@ public async Task HeadAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -109,11 +110,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -123,11 +124,11 @@ public RequestInformation ToHeadRequestInformation(Action /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public ReadOnlyResourceChannelsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.ReadOnlyResourceChannelsRequestBuilder WithUrl(string rawUrl) { - return new ReadOnlyResourceChannelsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.ReadOnlyResourceChannelsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves a collection of readOnlyResourceChannels. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/RelationshipChannelsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/RelationshipChannelsItemRequestBuilder.cs index f7f882a1cc..14e6795669 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/RelationshipChannelsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/RelationshipChannelsItemRequestBuilder.cs @@ -6,19 +6,20 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item +{ /// /// Builds and executes requests for operations under \relationshipChannels\{id} /// - public class RelationshipChannelsItemRequestBuilder : BaseRequestBuilder + public class RelationshipChannelsItemRequestBuilder : BaseRequestBuilder { /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -26,7 +27,7 @@ public RelationshipChannelsItemRequestBuilder(Dictionary pathPar { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs index d798d3b8da..50223ddce0 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams +{ /// /// Builds and executes requests for operations under \relationshipChannels\{id}\relationships\audioStreams /// - public class AudioStreamsRequestBuilder : BaseRequestBuilder + public class AudioStreamsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AudioStreamsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,52 +37,52 @@ public AudioStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Retrieves the related dataStream identities of an individual relationshipChannel's audioStreams relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -90,11 +91,11 @@ public async Task GetAsync(Actio /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -106,25 +107,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -134,25 +135,25 @@ public async Task PatchAsync(ToManyDataStreamInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -164,11 +165,11 @@ public async Task PostAsync(ToManyDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -185,11 +186,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest b /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -204,11 +205,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -223,11 +224,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -245,11 +246,11 @@ public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest bo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -262,11 +263,11 @@ public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AudioStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder WithUrl(string rawUrl) { - return new AudioStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identities of an individual relationshipChannel's audioStreams relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/RelationshipsRequestBuilder.cs index 7bde1029cc..fb51bd1e25 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships +{ /// /// Builds and executes requests for operations under \relationshipChannels\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The audioStreams property - public AudioStreamsRequestBuilder AudioStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder AudioStreams { - get => new AudioStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The ultraHighDefinitionVideoStream property - public UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream { - get => new UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// The videoStream property - public VideoStreamRequestBuilder VideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder VideoStream { - get => new VideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs index 26a64dfed8..f63c30bf25 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream +{ /// /// Builds and executes requests for operations under \relationshipChannels\{id}\relationships\ultraHighDefinitionVideoStream /// - public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder + public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public UltraHighDefinitionVideoStreamRequestBuilder(Dictionary p { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public UltraHighDefinitionVideoStreamRequestBuilder(string rawUrl, IRequestAdapt /// /// Retrieves the related dataStream identity of an individual relationshipChannel's ultraHighDefinitionVideoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, NullableDataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(Action< /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NullableToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(NullableToOneDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInReq /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) { - return new UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identity of an individual relationshipChannel's ultraHighDefinitionVideoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs index b343159350..f1921c5090 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream +{ /// /// Builds and executes requests for operations under \relationshipChannels\{id}\relationships\videoStream /// - public class VideoStreamRequestBuilder : BaseRequestBuilder + public class VideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public VideoStreamRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -33,27 +34,27 @@ public VideoStreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// /// Retrieves the related dataStream identity of an individual relationshipChannel's videoStream relationship. /// - /// A + /// A /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code + /// When receiving a 400 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToGetRequestInformation(requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, DataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. @@ -62,11 +63,11 @@ public async Task GetAsync(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif var requestInfo = ToHeadRequestInformation(requestConfiguration); @@ -78,25 +79,25 @@ public async Task HeadAsync(ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -107,11 +108,11 @@ public async Task PatchAsync(ToOneDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); @@ -126,11 +127,11 @@ public RequestInformation ToGetRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) { #endif var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); @@ -145,11 +146,11 @@ public RequestInformation ToHeadRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -162,11 +163,11 @@ public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder WithUrl(string rawUrl) { - return new VideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(rawUrl, RequestAdapter); } /// /// Retrieves the related dataStream identity of an individual relationshipChannel's videoStream relationship. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/RelationshipChannelsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/RelationshipChannelsRequestBuilder.cs index 8c4f038a4f..a4ad6d412a 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/RelationshipChannelsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RelationshipChannels/RelationshipChannelsRequestBuilder.cs @@ -6,26 +6,27 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels +{ /// /// Builds and executes requests for operations under \relationshipChannels /// - public class RelationshipChannelsRequestBuilder : BaseRequestBuilder + public class RelationshipChannelsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.relationshipChannels.item collection /// The identifier of the relationshipChannel whose related dataStream identities to retrieve. - /// A - public RelationshipChannelsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.RelationshipChannelsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new RelationshipChannelsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.Item.RelationshipChannelsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -33,7 +34,7 @@ public RelationshipChannelsRequestBuilder(Dictionary pathParamet { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RestrictedControllersClient.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RestrictedControllersClient.cs index 9264285664..51b2b26d72 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RestrictedControllersClient.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/RestrictedControllersClient.cs @@ -16,39 +16,40 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode +{ /// /// The main entry point of the SDK, exposes the configuration and the fluent API. /// - public class RestrictedControllersClient : BaseRequestBuilder + public class RestrictedControllersClient : BaseRequestBuilder { /// The dataStreams property - public DataStreamsRequestBuilder DataStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.DataStreamsRequestBuilder DataStreams { - get => new DataStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.DataStreams.DataStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The readOnlyChannels property - public ReadOnlyChannelsRequestBuilder ReadOnlyChannels + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.ReadOnlyChannelsRequestBuilder ReadOnlyChannels { - get => new ReadOnlyChannelsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyChannels.ReadOnlyChannelsRequestBuilder(PathParameters, RequestAdapter); } /// The readOnlyResourceChannels property - public ReadOnlyResourceChannelsRequestBuilder ReadOnlyResourceChannels + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.ReadOnlyResourceChannelsRequestBuilder ReadOnlyResourceChannels { - get => new ReadOnlyResourceChannelsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.ReadOnlyResourceChannels.ReadOnlyResourceChannelsRequestBuilder(PathParameters, RequestAdapter); } /// The relationshipChannels property - public RelationshipChannelsRequestBuilder RelationshipChannels + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.RelationshipChannelsRequestBuilder RelationshipChannels { - get => new RelationshipChannelsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.RelationshipChannels.RelationshipChannelsRequestBuilder(PathParameters, RequestAdapter); } /// The writeOnlyChannels property - public WriteOnlyChannelsRequestBuilder WriteOnlyChannels + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.WriteOnlyChannelsRequestBuilder WriteOnlyChannels { - get => new WriteOnlyChannelsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.WriteOnlyChannelsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The backing store to use for the models. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs index 3fcc46c423..a42ad9d9a5 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/AudioStreams/AudioStreamsRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams +{ /// /// Builds and executes requests for operations under \writeOnlyChannels\{id}\relationships\audioStreams /// - public class AudioStreamsRequestBuilder : BaseRequestBuilder + public class AudioStreamsRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public AudioStreamsRequestBuilder(Dictionary pathParameters, IRe { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,25 +37,25 @@ public AudioStreamsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task DeleteAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task DeleteAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -64,25 +65,25 @@ public async Task DeleteAsync(ToManyDataStreamInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -92,25 +93,25 @@ public async Task PatchAsync(ToManyDataStreamInRequest body, ActionThe request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -122,11 +123,11 @@ public async Task PostAsync(ToManyDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -144,11 +145,11 @@ public RequestInformation ToDeleteRequestInformation(ToManyDataStreamInRequest b /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -166,11 +167,11 @@ public RequestInformation ToPatchRequestInformation(ToManyDataStreamInRequest bo /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -183,11 +184,11 @@ public RequestInformation ToPostRequestInformation(ToManyDataStreamInRequest bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public AudioStreamsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder WithUrl(string rawUrl) { - return new AudioStreamsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(rawUrl, RequestAdapter); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs index 49934c1199..35556cc88d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/RelationshipsRequestBuilder.cs @@ -8,29 +8,30 @@ using System.Linq; using System.Threading.Tasks; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships +{ /// /// Builds and executes requests for operations under \writeOnlyChannels\{id}\relationships /// - public class RelationshipsRequestBuilder : BaseRequestBuilder + public class RelationshipsRequestBuilder : BaseRequestBuilder { /// The audioStreams property - public AudioStreamsRequestBuilder AudioStreams + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder AudioStreams { - get => new AudioStreamsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.AudioStreams.AudioStreamsRequestBuilder(PathParameters, RequestAdapter); } /// The ultraHighDefinitionVideoStream property - public UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder UltraHighDefinitionVideoStream { - get => new UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// The videoStream property - public VideoStreamRequestBuilder VideoStream + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder VideoStream { - get => new VideoStreamRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -38,7 +39,7 @@ public RelationshipsRequestBuilder(Dictionary pathParameters, IR { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs index 99f09bf1c7..41774fa514 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/UltraHighDefinitionVideoStream/UltraHighDefinitionVideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream +{ /// /// Builds and executes requests for operations under \writeOnlyChannels\{id}\relationships\ultraHighDefinitionVideoStream /// - public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder + public class UltraHighDefinitionVideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public UltraHighDefinitionVideoStreamRequestBuilder(Dictionary p { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,25 +37,25 @@ public UltraHighDefinitionVideoStreamRequestBuilder(string rawUrl, IRequestAdapt /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(NullableToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -66,11 +67,11 @@ public async Task PatchAsync(NullableToOneDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -83,11 +84,11 @@ public RequestInformation ToPatchRequestInformation(NullableToOneDataStreamInReq /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder WithUrl(string rawUrl) { - return new UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.UltraHighDefinitionVideoStream.UltraHighDefinitionVideoStreamRequestBuilder(rawUrl, RequestAdapter); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs index 15d9669c95..bb945b769f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/Relationships/VideoStream/VideoStreamRequestBuilder.cs @@ -8,14 +8,15 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream +{ /// /// Builds and executes requests for operations under \writeOnlyChannels\{id}\relationships\videoStream /// - public class VideoStreamRequestBuilder : BaseRequestBuilder + public class VideoStreamRequestBuilder : BaseRequestBuilder { /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -23,7 +24,7 @@ public VideoStreamRequestBuilder(Dictionary pathParameters, IReq { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -36,25 +37,25 @@ public VideoStreamRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(ToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(ToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } @@ -66,11 +67,11 @@ public async Task PatchAsync(ToOneDataStreamInRequest body, ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInRequest body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -83,11 +84,11 @@ public RequestInformation ToPatchRequestInformation(ToOneDataStreamInRequest bod /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public VideoStreamRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder WithUrl(string rawUrl) { - return new VideoStreamRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.VideoStream.VideoStreamRequestBuilder(rawUrl, RequestAdapter); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs index b6e8eb36ef..287ecbfcad 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/Item/WriteOnlyChannelsItemRequestBuilder.cs @@ -9,19 +9,20 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item +{ /// /// Builds and executes requests for operations under \writeOnlyChannels\{id} /// - public class WriteOnlyChannelsItemRequestBuilder : BaseRequestBuilder + public class WriteOnlyChannelsItemRequestBuilder : BaseRequestBuilder { /// The relationships property - public RelationshipsRequestBuilder Relationships + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.RelationshipsRequestBuilder Relationships { - get => new RelationshipsRequestBuilder(PathParameters, RequestAdapter); + get => new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -29,7 +30,7 @@ public WriteOnlyChannelsItemRequestBuilder(Dictionary pathParame { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -41,7 +42,7 @@ public WriteOnlyChannelsItemRequestBuilder(string rawUrl, IRequestAdapter reques /// /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 404 status code + /// When receiving a 404 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) @@ -54,40 +55,40 @@ public async Task DeleteAsync(Action> { - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Updates an existing writeOnlyChannel. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PatchAsync(UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PatchAsync(UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PatchAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPatchRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, WriteOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Deletes an existing writeOnlyChannel by its identifier. @@ -116,11 +117,11 @@ public RequestInformation ToDeleteRequestInformation(ActionConfiguration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPatchRequestInformation(UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPatchRequestInformation(UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.UpdateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -133,11 +134,11 @@ public RequestInformation ToPatchRequestInformation(UpdateWriteOnlyChannelReques /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public WriteOnlyChannelsItemRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.WriteOnlyChannelsItemRequestBuilder WithUrl(string rawUrl) { - return new WriteOnlyChannelsItemRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.WriteOnlyChannelsItemRequestBuilder(rawUrl, RequestAdapter); } /// /// Updates an existing writeOnlyChannel. diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs index d6c886eb65..f0f977a861 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/WriteOnlyChannels/WriteOnlyChannelsRequestBuilder.cs @@ -9,26 +9,27 @@ using System.Threading.Tasks; using System.Threading; using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels { +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels +{ /// /// Builds and executes requests for operations under \writeOnlyChannels /// - public class WriteOnlyChannelsRequestBuilder : BaseRequestBuilder + public class WriteOnlyChannelsRequestBuilder : BaseRequestBuilder { /// Gets an item from the OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.writeOnlyChannels.item collection /// The identifier of the writeOnlyChannel to update. - /// A - public WriteOnlyChannelsItemRequestBuilder this[string position] + /// A + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.WriteOnlyChannelsItemRequestBuilder this[string position] { get { var urlTplParams = new Dictionary(PathParameters); urlTplParams.Add("id", position); - return new WriteOnlyChannelsItemRequestBuilder(urlTplParams, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.Item.WriteOnlyChannelsItemRequestBuilder(urlTplParams, RequestAdapter); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// Path parameters for the request /// The request adapter to use to execute the requests. @@ -36,7 +37,7 @@ public WriteOnlyChannelsRequestBuilder(Dictionary pathParameters { } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// /// The raw URL to use for the request builder. /// The request adapter to use to execute the requests. @@ -46,35 +47,35 @@ public WriteOnlyChannelsRequestBuilder(string rawUrl, IRequestAdapter requestAda /// /// Creates a new writeOnlyChannel. /// - /// A + /// A /// The request body /// Cancellation token to use when cancelling requests /// Configuration for the request such as headers, query parameters, and middleware options. - /// When receiving a 400 status code - /// When receiving a 403 status code - /// When receiving a 404 status code - /// When receiving a 409 status code - /// When receiving a 422 status code + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public async Task PostAsync(CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) { #nullable restore #else - public async Task PostAsync(CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + public async Task PostAsync(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = ToPostRequestInformation(body, requestConfiguration); var errorMapping = new Dictionary> { - {"400", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"403", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"404", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"409", ErrorResponseDocument.CreateFromDiscriminatorValue}, - {"422", ErrorResponseDocument.CreateFromDiscriminatorValue}, + { "400", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, }; - return await RequestAdapter.SendAsync(requestInfo, WriteOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); } /// /// Creates a new writeOnlyChannel. @@ -84,11 +85,11 @@ public async Task PostAsync(CreateWrite /// Configuration for the request such as headers, query parameters, and middleware options. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public RequestInformation ToPostRequestInformation(CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument body, Action>? requestConfiguration = default) { #nullable restore #else - public RequestInformation ToPostRequestInformation(CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.CreateWriteOnlyChannelRequestDocument body, Action> requestConfiguration = default) { #endif _ = body ?? throw new ArgumentNullException(nameof(body)); @@ -101,11 +102,11 @@ public RequestInformation ToPostRequestInformation(CreateWriteOnlyChannelRequest /// /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. /// - /// A + /// A /// The raw URL to use for the request builder. - public WriteOnlyChannelsRequestBuilder WithUrl(string rawUrl) + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.WriteOnlyChannelsRequestBuilder WithUrl(string rawUrl) { - return new WriteOnlyChannelsRequestBuilder(rawUrl, RequestAdapter); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.WriteOnlyChannels.WriteOnlyChannelsRequestBuilder(rawUrl, RequestAdapter); } /// /// Creates a new writeOnlyChannel. From 9a90ef89ceb199286a559466c4d6cf8f2f69f907 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 10:47:10 +0200 Subject: [PATCH 3/7] Extract meta into component schema, allow any type as dictionary value (not only object) --- .../JsonApiDotNetCoreExample.json | 214 +++++++------- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- ...ullablePersonIdentifierResponseDocument.cs | 12 +- ...lePersonIdentifierResponseDocument_meta.cs | 60 ---- ...NullablePersonSecondaryResponseDocument.cs | 12 +- ...blePersonSecondaryResponseDocument_meta.cs | 60 ---- .../Models/NullableToOnePersonInResponse.cs | 12 +- .../NullableToOnePersonInResponse_meta.cs | 60 ---- .../PersonCollectionResponseDocument.cs | 12 +- .../PersonCollectionResponseDocument_meta.cs | 60 ---- .../Models/PersonDataInResponse.cs | 12 +- .../Models/PersonDataInResponse_meta.cs | 60 ---- .../PersonIdentifierResponseDocument.cs | 12 +- .../PersonIdentifierResponseDocument_meta.cs | 60 ---- .../Models/PersonPrimaryResponseDocument.cs | 12 +- .../PersonPrimaryResponseDocument_meta.cs | 60 ---- .../Models/PersonSecondaryResponseDocument.cs | 12 +- .../PersonSecondaryResponseDocument_meta.cs | 60 ---- .../Models/TagCollectionResponseDocument.cs | 12 +- .../TagCollectionResponseDocument_meta.cs | 60 ---- .../GeneratedCode/Models/TagDataInResponse.cs | 12 +- .../Models/TagDataInResponse_meta.cs | 60 ---- ...TagIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../Models/TagPrimaryResponseDocument.cs | 12 +- .../Models/TagPrimaryResponseDocument_meta.cs | 60 ---- .../Models/ToManyTagInResponse.cs | 12 +- .../Models/ToManyTagInResponse_meta.cs | 60 ---- .../Models/ToManyTodoItemInResponse.cs | 12 +- .../Models/ToManyTodoItemInResponse_meta.cs | 60 ---- .../Models/ToOnePersonInResponse.cs | 12 +- .../Models/ToOnePersonInResponse_meta.cs | 60 ---- .../TodoItemCollectionResponseDocument.cs | 12 +- ...TodoItemCollectionResponseDocument_meta.cs | 60 ---- .../Models/TodoItemDataInResponse.cs | 12 +- .../Models/TodoItemDataInResponse_meta.cs | 60 ---- ...temIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../Models/TodoItemPrimaryResponseDocument.cs | 12 +- .../TodoItemPrimaryResponseDocument_meta.cs | 60 ---- .../Documents/ErrorResponseDocument.cs | 2 +- ...lableResourceIdentifierResponseDocument.cs | 2 +- ...llableSecondaryResourceResponseDocument.cs | 2 +- .../PrimaryResourceResponseDocument.cs | 2 +- .../ResourceCollectionResponseDocument.cs | 2 +- ...rceIdentifierCollectionResponseDocument.cs | 2 +- .../ResourceIdentifierResponseDocument.cs | 2 +- .../SecondaryResourceResponseDocument.cs | 2 +- .../JsonApiObjects/Jsonapi.cs | 2 +- .../JsonApiObjects/Meta.cs | 9 + .../NullableToOneRelationshipInResponse.cs | 2 +- .../ToManyRelationshipInResponse.cs | 2 +- .../ToOneRelationshipInResponse.cs | 2 +- .../ResourceObjects/ResourceDataInResponse.cs | 2 +- .../JsonApiSchemaIdSelector.cs | 8 +- .../OpenApiSchemaExtensions.cs | 14 - .../ServiceCollectionExtensions.cs | 1 + .../DocumentSchemaGenerator.cs | 50 ++-- .../SwaggerComponents/MetaSchemaGenerator.cs | 43 +++ .../ResourceDataSchemaGenerator.cs | 2 - .../ResourceFieldSchemaBuilder.cs | 2 - .../ResourceTypeSchemaGenerator.cs | 2 +- .../AdditionalPropertiesTests.cs | 5 +- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../Models/GameDataInResponse.cs | 12 +- .../Models/GameDataInResponse_meta.cs | 60 ---- .../Models/GamePrimaryResponseDocument.cs | 12 +- .../GamePrimaryResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- .../Models/PlayerDataInResponse.cs | 12 +- .../Models/PlayerDataInResponse_meta.cs | 60 ---- .../Models/PlayerGroupDataInResponse.cs | 12 +- .../Models/PlayerGroupDataInResponse_meta.cs | 60 ---- .../PlayerGroupPrimaryResponseDocument.cs | 12 +- ...PlayerGroupPrimaryResponseDocument_meta.cs | 60 ---- .../Models/PlayerPrimaryResponseDocument.cs | 12 +- .../PlayerPrimaryResponseDocument_meta.cs | 60 ---- .../Models/ToManyGameInResponse.cs | 12 +- .../Models/ToManyGameInResponse_meta.cs | 60 ---- .../Models/ToManyPlayerGroupInResponse.cs | 12 +- .../ToManyPlayerGroupInResponse_meta.cs | 60 ---- .../Models/ToManyPlayerInResponse.cs | 12 +- .../Models/ToManyPlayerInResponse_meta.cs | 60 ---- .../CountryCollectionResponseDocument.cs | 12 +- .../CountryCollectionResponseDocument_meta.cs | 60 ---- .../Models/CountryDataInResponse.cs | 12 +- .../Models/CountryDataInResponse_meta.cs | 60 ---- .../Models/CountryPrimaryResponseDocument.cs | 12 +- .../CountryPrimaryResponseDocument_meta.cs | 60 ---- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../LanguageCollectionResponseDocument.cs | 12 +- ...LanguageCollectionResponseDocument_meta.cs | 60 ---- .../Models/LanguageDataInResponse.cs | 12 +- .../Models/LanguageDataInResponse_meta.cs | 60 ---- ...ageIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- .../Models/ToManyLanguageInResponse.cs | 12 +- .../Models/ToManyLanguageInResponse_meta.cs | 60 ---- ...AccommodationCollectionResponseDocument.cs | 12 +- ...modationCollectionResponseDocument_meta.cs | 60 ---- .../Models/AccommodationDataInResponse.cs | 12 +- .../AccommodationDataInResponse_meta.cs | 60 ---- ...AccommodationIdentifierResponseDocument.cs | 12 +- ...modationIdentifierResponseDocument_meta.cs | 60 ---- .../AccommodationPrimaryResponseDocument.cs | 12 +- ...commodationPrimaryResponseDocument_meta.cs | 60 ---- .../AccommodationSecondaryResponseDocument.cs | 12 +- ...mmodationSecondaryResponseDocument_meta.cs | 60 ---- .../Links/GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../ExcursionCollectionResponseDocument.cs | 12 +- ...xcursionCollectionResponseDocument_meta.cs | 60 ---- .../Models/ExcursionDataInResponse.cs | 12 +- .../Models/ExcursionDataInResponse_meta.cs | 60 ---- ...ionIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../ExcursionPrimaryResponseDocument.cs | 12 +- .../ExcursionPrimaryResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- .../NullableToOneTransportInResponse.cs | 12 +- .../NullableToOneTransportInResponse_meta.cs | 60 ---- ...ableTransportIdentifierResponseDocument.cs | 12 +- ...ransportIdentifierResponseDocument_meta.cs | 60 ---- ...lableTransportSecondaryResponseDocument.cs | 12 +- ...TransportSecondaryResponseDocument_meta.cs | 60 ---- .../Models/ToManyExcursionInResponse.cs | 12 +- .../Models/ToManyExcursionInResponse_meta.cs | 60 ---- .../Models/ToOneAccommodationInResponse.cs | 12 +- .../ToOneAccommodationInResponse_meta.cs | 60 ---- .../TransportCollectionResponseDocument.cs | 12 +- ...ransportCollectionResponseDocument_meta.cs | 60 ---- .../Models/TransportDataInResponse.cs | 12 +- .../Models/TransportDataInResponse_meta.cs | 60 ---- .../TransportPrimaryResponseDocument.cs | 12 +- .../TransportPrimaryResponseDocument_meta.cs | 60 ---- .../VacationCollectionResponseDocument.cs | 12 +- ...VacationCollectionResponseDocument_meta.cs | 60 ---- .../Models/VacationDataInResponse.cs | 12 +- .../Models/VacationDataInResponse_meta.cs | 60 ---- .../Models/VacationPrimaryResponseDocument.cs | 12 +- .../VacationPrimaryResponseDocument_meta.cs | 60 ---- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- .../SocialMediaAccountDataInResponse.cs | 12 +- .../SocialMediaAccountDataInResponse_meta.cs | 60 ---- ...cialMediaAccountPrimaryResponseDocument.cs | 12 +- ...ediaAccountPrimaryResponseDocument_meta.cs | 60 ---- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- ...NameValuePairCollectionResponseDocument.cs | 12 +- ...aluePairCollectionResponseDocument_meta.cs | 60 ---- .../Models/NameValuePairDataInResponse.cs | 12 +- .../NameValuePairDataInResponse_meta.cs | 60 ---- ...airIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../NameValuePairPrimaryResponseDocument.cs | 12 +- ...meValuePairPrimaryResponseDocument_meta.cs | 60 ---- .../Models/NodeCollectionResponseDocument.cs | 12 +- .../NodeCollectionResponseDocument_meta.cs | 60 ---- .../Models/NodeDataInResponse.cs | 12 +- .../Models/NodeDataInResponse_meta.cs | 60 ---- ...odeIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../Models/NodeIdentifierResponseDocument.cs | 12 +- .../NodeIdentifierResponseDocument_meta.cs | 60 ---- .../Models/NodePrimaryResponseDocument.cs | 12 +- .../NodePrimaryResponseDocument_meta.cs | 60 ---- .../Models/NodeSecondaryResponseDocument.cs | 12 +- .../NodeSecondaryResponseDocument_meta.cs | 60 ---- .../NullableNodeIdentifierResponseDocument.cs | 12 +- ...ableNodeIdentifierResponseDocument_meta.cs | 60 ---- .../NullableNodeSecondaryResponseDocument.cs | 12 +- ...lableNodeSecondaryResponseDocument_meta.cs | 60 ---- .../Models/NullableToOneNodeInResponse.cs | 12 +- .../NullableToOneNodeInResponse_meta.cs | 60 ---- .../Models/ToManyNameValuePairInResponse.cs | 12 +- .../ToManyNameValuePairInResponse_meta.cs | 60 ---- .../Models/ToManyNodeInResponse.cs | 12 +- .../Models/ToManyNodeInResponse_meta.cs | 60 ---- .../Models/ToOneNodeInResponse.cs | 12 +- .../Models/ToOneNodeInResponse_meta.cs | 60 ---- .../DataStreamCollectionResponseDocument.cs | 12 +- ...taStreamCollectionResponseDocument_meta.cs | 60 ---- .../Models/DataStreamDataInResponse.cs | 12 +- .../Models/DataStreamDataInResponse_meta.cs | 60 ---- ...eamIdentifierCollectionResponseDocument.cs | 12 +- ...entifierCollectionResponseDocument_meta.cs | 60 ---- .../DataStreamIdentifierResponseDocument.cs | 12 +- ...taStreamIdentifierResponseDocument_meta.cs | 60 ---- .../DataStreamPrimaryResponseDocument.cs | 12 +- .../DataStreamPrimaryResponseDocument_meta.cs | 60 ---- .../DataStreamSecondaryResponseDocument.cs | 12 +- ...ataStreamSecondaryResponseDocument_meta.cs | 60 ---- .../GeneratedCode/Models/ErrorObject.cs | 12 +- .../Models/ErrorResponseDocument.cs | 12 +- .../Models/ErrorResponseDocument_meta.cs | 60 ---- .../Models/{ErrorObject_meta.cs => Meta.cs} | 12 +- ...bleDataStreamIdentifierResponseDocument.cs | 12 +- ...taStreamIdentifierResponseDocument_meta.cs | 60 ---- ...ableDataStreamSecondaryResponseDocument.cs | 12 +- ...ataStreamSecondaryResponseDocument_meta.cs | 60 ---- .../NullableToOneDataStreamInResponse.cs | 12 +- .../NullableToOneDataStreamInResponse_meta.cs | 60 ---- ...adOnlyChannelCollectionResponseDocument.cs | 12 +- ...yChannelCollectionResponseDocument_meta.cs | 60 ---- .../Models/ReadOnlyChannelDataInResponse.cs | 12 +- .../ReadOnlyChannelDataInResponse_meta.cs | 60 ---- .../ReadOnlyChannelPrimaryResponseDocument.cs | 12 +- ...OnlyChannelPrimaryResponseDocument_meta.cs | 60 ---- ...sourceChannelCollectionResponseDocument.cs | 12 +- ...eChannelCollectionResponseDocument_meta.cs | 60 ---- .../ReadOnlyResourceChannelDataInResponse.cs | 12 +- ...dOnlyResourceChannelDataInResponse_meta.cs | 60 ---- ...yResourceChannelPrimaryResponseDocument.cs | 12 +- ...urceChannelPrimaryResponseDocument_meta.cs | 60 ---- .../Models/ToManyDataStreamInResponse.cs | 12 +- .../Models/ToManyDataStreamInResponse_meta.cs | 60 ---- .../Models/ToOneDataStreamInResponse.cs | 12 +- .../Models/ToOneDataStreamInResponse_meta.cs | 60 ---- .../Models/WriteOnlyChannelDataInResponse.cs | 12 +- .../WriteOnlyChannelDataInResponse_meta.cs | 60 ---- ...WriteOnlyChannelPrimaryResponseDocument.cs | 12 +- ...OnlyChannelPrimaryResponseDocument_meta.cs | 60 ---- .../GeneratedSwagger/swagger.g.json | 114 ++++---- .../Headers/GeneratedSwagger/swagger.g.json | 94 +++--- .../GeneratedSwagger/swagger.g.json | 274 +++++++++--------- .../LegacyOpenApi/expected-swagger.json | 274 +++++++++--------- .../Enabled/GeneratedSwagger/swagger.g.json | 224 +++++++------- .../GeneratedSwagger/net6.0/swagger.g.json | 44 +-- .../GeneratedSwagger/net8.0/swagger.g.json | 44 +-- .../CamelCase/GeneratedSwagger/swagger.g.json | 174 +++++------ .../KebabCase/GeneratedSwagger/swagger.g.json | 174 +++++------ .../GeneratedSwagger/swagger.g.json | 174 +++++------ .../GeneratedSwagger/swagger.g.json | 184 ++++++------ .../GeneratedSwagger/swagger.g.json | 124 ++++---- .../GeneratedSwagger/swagger.g.json | 154 +++++----- .../GeneratedSwagger/swagger.g.json | 154 +++++----- .../GeneratedSwagger/swagger.g.json | 154 +++++----- .../GeneratedSwagger/swagger.g.json | 214 +++++++------- 252 files changed, 2249 insertions(+), 7997 deletions(-) delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (88%) delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs delete mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Meta.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (85%) delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (87%) delete mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (87%) delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (85%) delete mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (86%) delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{ErrorObject_meta.cs => Meta.cs} (85%) delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs delete mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs diff --git a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json index 5924064de8..674080b3a9 100644 --- a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json +++ b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json @@ -5139,9 +5139,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5167,11 +5169,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5206,6 +5208,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullablePersonIdentifierResponseDocument": { "required": [ "data", @@ -5229,11 +5237,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5267,11 +5275,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5312,11 +5320,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5365,11 +5373,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5404,11 +5412,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5455,11 +5463,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5492,11 +5500,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5556,11 +5564,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5824,11 +5832,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5863,11 +5871,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5913,11 +5921,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5950,11 +5958,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6011,11 +6019,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6052,11 +6060,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6095,11 +6103,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6161,11 +6169,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6200,11 +6208,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6250,11 +6258,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6287,11 +6295,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs index 11a3f0aa02..0890009749 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs index 578fa28136..7fff094920 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index bc12b9eb0c..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Meta.cs similarity index 88% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Meta.cs index b13fe58bdb..9870f6f6f0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ErrorObject_meta.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs index 3aed69aae1..4df6541a8a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs deleted file mode 100644 index 2160b0f615..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullablePersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullablePersonIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs index 489f707bb1..2061e13dd8 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs deleted file mode 100644 index 3e3404dbff..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullablePersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullablePersonSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.NullablePersonSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs index 13c01c0b44..b44db2f787 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs deleted file mode 100644 index b1891bff97..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableToOnePersonInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.NullableToOnePersonInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs index 2bacfc6923..a44e83b6c0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs deleted file mode 100644 index ef283cc797..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PersonCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PersonCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs index 05dbd78c35..8c2ba270fa 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs deleted file mode 100644 index 931730a1c4..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PersonDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PersonDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs index 3a27d84d0a..9b340aac54 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs deleted file mode 100644 index ed64925499..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PersonIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PersonIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs index 4768336cdb..bafd4413d3 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs deleted file mode 100644 index cf3d4cbd23..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PersonPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PersonPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs index 38eaa557c2..047e256ff1 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs deleted file mode 100644 index 9190eb2484..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PersonSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PersonSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs index 71f90c1e07..686104825a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs deleted file mode 100644 index ac61c9b5e9..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TagCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TagCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TagCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs index 3777ec2c31..b1953a2f14 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs deleted file mode 100644 index 9540317de9..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TagDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TagDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs index a287b6a3e4..5941bea00b 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollecti /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index c80c65b03a..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TagIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TagIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs index dda8457413..04a010de96 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs deleted file mode 100644 index fd5d2aa45d..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TagPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TagPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TagPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs index f00715e8f1..2918405f45 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs deleted file mode 100644 index 60e036f613..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyTagInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyTagInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTagInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs index 436bf2adc5..e369ac108a 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs deleted file mode 100644 index 0cafabe1d9..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyTodoItemInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyTodoItemInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.ToManyTodoItemInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs index bc302be9f1..9227f37c80 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs deleted file mode 100644 index 38da624af8..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToOnePersonInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToOnePersonInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.ToOnePersonInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs index e7bffcdfa4..83924d4d82 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs deleted file mode 100644 index eb3c64625b..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TodoItemCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TodoItemCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs index 7d37cf6f06..f5833e65e2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs deleted file mode 100644 index 6cba3aea9c..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TodoItemDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TodoItemDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs index bb1a4d5e99..78aa7b38c2 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollecti /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index da00e6a419..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TodoItemIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TodoItemIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs index 88c6445519..afd9d6e6dd 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta? Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta Meta + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs deleted file mode 100644 index 5a93bd7dc8..0000000000 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaClientExample.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TodoItemPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TodoItemPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ErrorResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ErrorResponseDocument.cs index b72f4e30b9..433c9db740 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ErrorResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ErrorResponseDocument.cs @@ -21,5 +21,5 @@ internal sealed class ErrorResponseDocument public IList Errors { get; set; } = new List(); [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs index b86acb14f9..83db84c5d8 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs @@ -25,5 +25,5 @@ internal sealed class NullableResourceIdentifierResponseDocument public ResourceIdentifier? Data { get; set; } [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableSecondaryResourceResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableSecondaryResourceResponseDocument.cs index 3924585989..4a1df8fbf0 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableSecondaryResourceResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableSecondaryResourceResponseDocument.cs @@ -26,5 +26,5 @@ internal sealed class NullableSecondaryResourceResponseDocument public IList Included { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/PrimaryResourceResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/PrimaryResourceResponseDocument.cs index ad23955ec6..58704de5f4 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/PrimaryResourceResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/PrimaryResourceResponseDocument.cs @@ -26,5 +26,5 @@ internal sealed class PrimaryResourceResponseDocument public IList Included { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceCollectionResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceCollectionResponseDocument.cs index 3ca8783313..3a2c4d2369 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceCollectionResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceCollectionResponseDocument.cs @@ -26,5 +26,5 @@ internal sealed class ResourceCollectionResponseDocument public IList Included { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs index 5d400f48f5..974fd45aef 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs @@ -23,5 +23,5 @@ internal sealed class ResourceIdentifierCollectionResponseDocument public ICollection> Data { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs index f47a3306d5..413cdcb98f 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs @@ -23,5 +23,5 @@ internal sealed class ResourceIdentifierResponseDocument public ResourceIdentifier Data { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/SecondaryResourceResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/SecondaryResourceResponseDocument.cs index bfe70b0ea4..a0dc712fcd 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/SecondaryResourceResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/SecondaryResourceResponseDocument.cs @@ -26,5 +26,5 @@ internal sealed class SecondaryResourceResponseDocument public IList Included { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Jsonapi.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Jsonapi.cs index dcfc6ae2ca..40ab7ad941 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Jsonapi.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Jsonapi.cs @@ -16,5 +16,5 @@ internal sealed class Jsonapi public ICollection Profile { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Meta.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Meta.cs new file mode 100644 index 0000000000..7f8c403156 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Meta.cs @@ -0,0 +1,9 @@ +using JetBrains.Annotations; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class Meta +{ + // No members, because the component schema is custom-generated. +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs index 52f1bbc120..a967efb35b 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs @@ -20,5 +20,5 @@ internal sealed class NullableToOneRelationshipInResponse public ResourceIdentifier? Data { get; set; } [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs index 8c78f09adb..24600d9027 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs @@ -20,5 +20,5 @@ internal sealed class ToManyRelationshipInResponse public ICollection> Data { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs index bc66ae7581..c9f3c0a655 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs @@ -20,5 +20,5 @@ internal sealed class ToOneRelationshipInResponse public ResourceIdentifier Data { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs index 8a7e6d5748..59733d5c88 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs @@ -20,5 +20,5 @@ internal sealed class ResourceDataInResponse : ResourceData public ResourceLinks Links { get; set; } = null!; [JsonPropertyName("meta")] - public IDictionary Meta { get; set; } = null!; + public Meta Meta { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs index 029372c551..2a91ebf0b2 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs @@ -10,6 +10,7 @@ namespace JsonApiDotNetCore.OpenApi; internal sealed class JsonApiSchemaIdSelector { private const string ResourceTypeSchemaIdTemplate = "[ResourceName] Resource Type"; + private const string MetaSchemaIdTemplate = "Meta"; private static readonly IDictionary TypeToSchemaTemplateMap = new Dictionary { @@ -98,10 +99,15 @@ private string ApplySchemaTemplate(string schemaTemplate, ResourceType? resource return namingPolicy != null ? namingPolicy.ConvertName(pascalCaseSchemaId) : pascalCaseSchemaId; } - public string GetSchemaId(ResourceType resourceType) + public string GetResourceTypeSchemaId(ResourceType resourceType) { ArgumentGuard.NotNull(resourceType); return ApplySchemaTemplate(ResourceTypeSchemaIdTemplate, resourceType); } + + public string GetMetaSchemaId() + { + return ApplySchemaTemplate(MetaSchemaIdTemplate, null); + } } diff --git a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs index 8894d68600..ac1739487b 100644 --- a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs @@ -38,18 +38,4 @@ public static OpenApiSchema UnwrapExtendedReferenceSchema(this OpenApiSchema sou return source.AllOf.Single(); } - - public static void SetValuesInMetaToNullable(this OpenApiSchema fullSchema) - { - ArgumentGuard.NotNull(fullSchema); - - if (fullSchema.Properties.TryGetValue(JsonApiPropertyName.Meta, out OpenApiSchema? schemaForMeta)) - { - schemaForMeta.AdditionalProperties = new OpenApiSchema - { - Type = "object", - Nullable = true - }; - } - } } diff --git a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs index 7df1945c66..54c25f649e 100644 --- a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs @@ -88,6 +88,7 @@ private static void AddSchemaGenerators(IServiceCollection services) services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs index cc9376a353..91386e8642 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs @@ -1,7 +1,9 @@ using System.Reflection; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.OpenApi.JsonApiObjects; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Serialization.Objects; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; @@ -12,18 +14,21 @@ internal sealed class DocumentSchemaGenerator private readonly SchemaGenerator _defaultSchemaGenerator; private readonly AbstractResourceDataSchemaGenerator _abstractResourceDataSchemaGenerator; private readonly ResourceDataSchemaGenerator _resourceDataSchemaGenerator; + private readonly MetaSchemaGenerator _metaSchemaGenerator; private readonly LinksVisibilitySchemaGenerator _linksVisibilitySchemaGenerator; private readonly IncludeDependencyScanner _includeDependencyScanner; private readonly IResourceGraph _resourceGraph; private readonly IJsonApiOptions _options; public DocumentSchemaGenerator(SchemaGenerator defaultSchemaGenerator, AbstractResourceDataSchemaGenerator abstractResourceDataSchemaGenerator, - ResourceDataSchemaGenerator resourceDataSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, - IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph, IJsonApiOptions options) + ResourceDataSchemaGenerator resourceDataSchemaGenerator, MetaSchemaGenerator metaSchemaGenerator, + LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph, + IJsonApiOptions options) { ArgumentGuard.NotNull(defaultSchemaGenerator); ArgumentGuard.NotNull(abstractResourceDataSchemaGenerator); ArgumentGuard.NotNull(resourceDataSchemaGenerator); + ArgumentGuard.NotNull(metaSchemaGenerator); ArgumentGuard.NotNull(linksVisibilitySchemaGenerator); ArgumentGuard.NotNull(includeDependencyScanner); ArgumentGuard.NotNull(resourceGraph); @@ -32,6 +37,7 @@ public DocumentSchemaGenerator(SchemaGenerator defaultSchemaGenerator, AbstractR _defaultSchemaGenerator = defaultSchemaGenerator; _abstractResourceDataSchemaGenerator = abstractResourceDataSchemaGenerator; _resourceDataSchemaGenerator = resourceDataSchemaGenerator; + _metaSchemaGenerator = metaSchemaGenerator; _linksVisibilitySchemaGenerator = linksVisibilitySchemaGenerator; _includeDependencyScanner = includeDependencyScanner; _resourceGraph = resourceGraph; @@ -43,21 +49,39 @@ public OpenApiSchema GenerateSchema(Type modelType, SchemaRepository schemaRepos ArgumentGuard.NotNull(modelType); ArgumentGuard.NotNull(schemaRepository); + _ = _metaSchemaGenerator.GenerateSchema(schemaRepository); + + if (modelType == typeof(ErrorResponseDocument)) + { + GenerateErrorObjectSchema(schemaRepository); + } + OpenApiSchema referenceSchemaForDocument = modelType.IsConstructedGenericType ? GenerateJsonApiDocumentSchema(modelType, schemaRepository) : _defaultSchemaGenerator.GenerateSchema(modelType, schemaRepository); OpenApiSchema fullSchemaForDocument = schemaRepository.Schemas[referenceSchemaForDocument.Reference.Id]; - SetJsonApiVersion(fullSchemaForDocument, schemaRepository); + SetJsonApiVersion(fullSchemaForDocument); _linksVisibilitySchemaGenerator.UpdateSchemaForTopLevel(modelType, fullSchemaForDocument, schemaRepository); - fullSchemaForDocument.SetValuesInMetaToNullable(); - return referenceSchemaForDocument; } + private void GenerateErrorObjectSchema(SchemaRepository schemaRepository) + { + OpenApiSchema referenceSchemaForErrorObject = _defaultSchemaGenerator.GenerateSchema(typeof(ErrorObject), schemaRepository); + OpenApiSchema fullSchemaForErrorObject = schemaRepository.Schemas[referenceSchemaForErrorObject.Reference.Id]; + + OpenApiSchema referenceSchemaForMeta = _metaSchemaGenerator.GenerateSchema(schemaRepository); + + fullSchemaForErrorObject.Properties[JsonApiPropertyName.Meta] = new OpenApiSchema + { + AllOf = [referenceSchemaForMeta] + }; + } + private OpenApiSchema GenerateJsonApiDocumentSchema(Type documentType, SchemaRepository schemaRepository) { // There's no way to intercept in the Swashbuckle recursive component schema generation when using inheritance, which we need @@ -127,21 +151,11 @@ private static void SetDataSchemaToNullable(OpenApiSchema fullSchemaForDocument) fullSchemaForDocument.Properties[JsonApiPropertyName.Data] = referenceSchemaForData; } - private void SetJsonApiVersion(OpenApiSchema fullSchemaForDocument, SchemaRepository schemaRepository) + private void SetJsonApiVersion(OpenApiSchema fullSchemaForDocument) { - if (fullSchemaForDocument.Properties.TryGetValue(JsonApiPropertyName.Jsonapi, out OpenApiSchema? referenceSchemaForJsonapi)) + if (fullSchemaForDocument.Properties.ContainsKey(JsonApiPropertyName.Jsonapi) && !_options.IncludeJsonApiVersion) { - string jsonapiSchemaId = referenceSchemaForJsonapi.AllOf[0].Reference.Id; - - if (!_options.IncludeJsonApiVersion) - { - fullSchemaForDocument.Properties.Remove(JsonApiPropertyName.Jsonapi); - } - else - { - OpenApiSchema fullSchemaForJsonapi = schemaRepository.Schemas[jsonapiSchemaId]; - fullSchemaForJsonapi.SetValuesInMetaToNullable(); - } + fullSchemaForDocument.Properties.Remove(JsonApiPropertyName.Jsonapi); } } } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs new file mode 100644 index 0000000000..0c2d19b901 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs @@ -0,0 +1,43 @@ +using JsonApiDotNetCore.OpenApi.JsonApiObjects; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; + +internal sealed class MetaSchemaGenerator +{ + private readonly JsonApiSchemaIdSelector _schemaIdSelector; + + public MetaSchemaGenerator(JsonApiSchemaIdSelector schemaIdSelector) + { + ArgumentGuard.NotNull(schemaIdSelector); + + _schemaIdSelector = schemaIdSelector; + } + + public OpenApiSchema GenerateSchema(SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.TryLookupByType(typeof(Meta), out OpenApiSchema? referenceSchema)) + { + return referenceSchema; + } + + var fullSchema = new OpenApiSchema + { + Type = "object", + AdditionalProperties = new OpenApiSchema + { + Nullable = true + } + }; + + string schemaId = _schemaIdSelector.GetMetaSchemaId(); + + referenceSchema = schemaRepository.AddDefinition(schemaId, fullSchema); + schemaRepository.RegisterType(typeof(Meta), schemaId); + + return referenceSchema; + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs index 6faf472e9e..2479e817b7 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs @@ -91,8 +91,6 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo _linksVisibilitySchemaGenerator.UpdateSchemaForResource(resourceTypeInfo, effectiveFullSchemaForResourceData, schemaRepository); - effectiveFullSchemaForResourceData.SetValuesInMetaToNullable(); - #if NET6_0 effectiveFullSchemaForResourceData.ReorderProperties(ResourceDataPropertyNamesInOrder); #endif diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs index 3264f62394..c8bf0262ed 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs @@ -200,8 +200,6 @@ private OpenApiSchema CreateRelationshipReferenceSchema(Type relationshipSchemaT _linksVisibilitySchemaGenerator.UpdateSchemaForRelationship(relationshipSchemaType, fullSchema, schemaRepository); fullSchema.Required.Remove(JsonApiPropertyName.Data); - - fullSchema.SetValuesInMetaToNullable(); } return referenceSchema; diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs index 4fb5d0d1a4..bf5f699725 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs @@ -36,7 +36,7 @@ public OpenApiSchema Get(ResourceType resourceType, SchemaRepository schemaRepos AdditionalPropertiesAllowed = false }; - string schemaId = _schemaIdSelector.GetSchemaId(resourceType); + string schemaId = _schemaIdSelector.GetResourceTypeSchemaId(resourceType); referenceSchema = new OpenApiSchema { diff --git a/test/OpenApiKiotaEndToEndTests/AdditionalPropertiesTests.cs b/test/OpenApiKiotaEndToEndTests/AdditionalPropertiesTests.cs index c353e08224..d3f8d75d43 100644 --- a/test/OpenApiKiotaEndToEndTests/AdditionalPropertiesTests.cs +++ b/test/OpenApiKiotaEndToEndTests/AdditionalPropertiesTests.cs @@ -6,7 +6,7 @@ namespace OpenApiKiotaEndToEndTests; public sealed class AdditionalPropertiesTests { - private static readonly string GeneratedCodeDirectory = $"{Path.PathSeparator}GeneratedCode{Path.PathSeparator}"; + private static readonly string GeneratedCodeDirectory = $"{Path.DirectorySeparatorChar}GeneratedCode{Path.DirectorySeparatorChar}"; [Fact] public async Task Additional_properties_are_only_allowed_in_meta() @@ -19,7 +19,8 @@ public async Task Additional_properties_are_only_allowed_in_meta() RecurseSubdirectories = true })) { - if (path.Contains(GeneratedCodeDirectory, StringComparison.OrdinalIgnoreCase) && !path.EndsWith("_meta.cs", StringComparison.OrdinalIgnoreCase)) + if (path.Contains(GeneratedCodeDirectory, StringComparison.OrdinalIgnoreCase) && + !string.Equals(Path.GetFileName(path), "Meta.cs", StringComparison.OrdinalIgnoreCase)) { string content = await File.ReadAllTextAsync(path); bool containsAdditionalData = content.Contains("public IDictionary AdditionalData"); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs index 87012f04b5..013a6e2872 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Er /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs index 389b7bd2d6..95cce42d1d 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Er /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index ae59e31f93..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs index e234ad3512..f4e55bdd54 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs deleted file mode 100644 index bc92d806df..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class GameDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public GameDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs index 0630b434b3..86e8d219b0 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs deleted file mode 100644 index d562854a1c..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GamePrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class GamePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public GamePrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GamePrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Meta.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Meta.cs index 36e4bdedeb..70a84c82c7 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs index 977cfef0e8..4995a8cc88 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs deleted file mode 100644 index 257b303604..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PlayerDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PlayerDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs index 4b21e4a36b..12afdf702f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs deleted file mode 100644 index 9cf8f0c6f7..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PlayerGroupDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PlayerGroupDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs index 30b5b105ed..3dce5f5854 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs deleted file mode 100644 index 88b112e338..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PlayerGroupPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PlayerGroupPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs index 05c1d2236c..5e2a3b152d 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs deleted file mode 100644 index 2de83b41c8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class PlayerPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public PlayerPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs index 2232ecd983..b682872637 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs deleted file mode 100644 index f2b5c7be46..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyGameInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyGameInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyGameInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs index b62f0bfcc6..fe9c8e5d7f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs deleted file mode 100644 index 1ea3639ba7..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyPlayerGroupInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyPlayerGroupInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerGroupInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs index 4423dc2fe3..9e49454b3a 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Re /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs deleted file mode 100644 index d0124b20cd..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyPlayerInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyPlayerInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ToManyPlayerInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs index c8bddf483a..2e5ef72f31 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollection /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs deleted file mode 100644 index d8575601e4..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class CountryCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public CountryCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs index 7aabb9b4e2..cb5b20c334 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs deleted file mode 100644 index 4319a3b2f5..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class CountryDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public CountryDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs index b42629dafc..b69f6471df 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLi /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs deleted file mode 100644 index fcd93996e4..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class CountryPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public CountryPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs index b1a6305861..ca4f9707dd 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs index df637f86c4..5cae9ae197 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index cb35ee37f8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs index bbf6e9e0e6..a29ce4c39f 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollection /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs deleted file mode 100644 index 2fa5399420..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class LanguageCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public LanguageCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs index 0a3f9be3b9..a2488a88f1 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks Link /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs deleted file mode 100644 index 2d0960656e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class LanguageDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public LanguageDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs index feb80c750a..1459e9779f 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifier /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index eb439ecb58..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class LanguageIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public LanguageIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Meta.cs similarity index 87% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Meta.cs index 157a35b838..67611f791a 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs index d1c34563e6..908f2fb61e 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs deleted file mode 100644 index 42c5f0b7ad..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyLanguageInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyLanguageInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ToManyLanguageInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs index 144231b8c3..5da53be66e 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs deleted file mode 100644 index 14343ff0ad..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class AccommodationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public AccommodationCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs index 833f650a2f..dd3b6878de 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs deleted file mode 100644 index b278ad09bb..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class AccommodationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public AccommodationDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs index da7dbf3dfa..9840501645 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs deleted file mode 100644 index 3613eec578..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class AccommodationIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public AccommodationIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs index 7911b7576b..3ff4c9d442 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs deleted file mode 100644 index c161a1ee33..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class AccommodationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public AccommodationPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs index a075426139..55469de2be 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs deleted file mode 100644 index 5ff9048c4e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class AccommodationSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public AccommodationSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs index 5429fae01a..873a4e4308 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs index 1d2abd090d..99e060e4ad 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks L /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index a7143635d8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs index 545262acc8..595e2f6b27 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs deleted file mode 100644 index c959512ea1..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ExcursionCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ExcursionCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs index 4bff032c91..18a0381b14 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs deleted file mode 100644 index 9cf584afbb..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ExcursionDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ExcursionDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs index 606a0065b0..1d85d75531 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index a85f701878..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ExcursionIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ExcursionIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs index 76b770a86f..8e633ff1fd 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs deleted file mode 100644 index e87c5291f4..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ExcursionPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ExcursionPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Meta.cs similarity index 87% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Meta.cs index 4c706f9590..2078b7a0be 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs index 75f0d7cd34..0f0fa0b060 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Li /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs deleted file mode 100644 index 4a0aabf4dc..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableToOneTransportInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableToOneTransportInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableToOneTransportInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs index 6c35132521..2b28d31b97 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs deleted file mode 100644 index bf9b788653..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableTransportIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableTransportIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs index 040ba264ae..40e0180a50 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs deleted file mode 100644 index cfefb685a5..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableTransportSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableTransportSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.NullableTransportSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs index b594cb52f3..925f99970c 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Li /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs deleted file mode 100644 index 8b2569cb30..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyExcursionInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyExcursionInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToManyExcursionInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs index ec9d8e04d0..09f8f98a2b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks Li /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs deleted file mode 100644 index 5e8a0eebdf..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToOneAccommodationInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToOneAccommodationInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ToOneAccommodationInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs index 289d08d652..144cb05405 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs deleted file mode 100644 index 268b4c9c01..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TransportCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TransportCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs index 29569bad4e..d5aece93a4 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs deleted file mode 100644 index 7d4bffc871..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TransportDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TransportDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs index 5c477168d7..6ceb2f0a7a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs deleted file mode 100644 index a16fad449d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class TransportPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public TransportPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs index e48ea64271..b289aebfcd 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTo /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs deleted file mode 100644 index 95a045f82d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class VacationCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public VacationCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs index ef4be7843a..1d0613fce7 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks Links /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs deleted file mode 100644 index 3e9c0530fb..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class VacationDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public VacationDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs index 175df91a4e..ce01f4b63d 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLink /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs deleted file mode 100644 index b460aa2aa7..0000000000 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class VacationPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public VacationPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs index 8e812b36bd..868feede93 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Error /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs index 272b326c76..7f88ff1f97 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Error /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index 786d6d9e11..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/Meta.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/Meta.cs index 4253f69aca..3b77788592 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs index 3d9a4af69e..2bd3f3aed3 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Resou /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs deleted file mode 100644 index 19d72bccc3..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class SocialMediaAccountDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public SocialMediaAccountDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs index 703b0ca10e..9a39743f10 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Resou /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs deleted file mode 100644 index 80d3e82398..0000000000 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class SocialMediaAccountPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public SocialMediaAccountPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs index 321cf96703..b42992f4a1 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks Li /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs index 412d826b28..e522d2c8b5 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevel /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index e646b8cd48..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Meta.cs similarity index 86% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Meta.cs index b6568886b1..dc7273447c 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs index de1dbeb66f..4ac451771a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceColle /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs deleted file mode 100644 index b3cbb4b580..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NameValuePairCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NameValuePairCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs index ddae8300cd..9be00d2c52 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs deleted file mode 100644 index 67a0002e77..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NameValuePairDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NameValuePairDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs index 2609e84ac2..35906005fa 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdent /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index 3f729ee057..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NameValuePairIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NameValuePairIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs index ada9ff0a70..5986c97d4f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLe /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs deleted file mode 100644 index 299966002e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NameValuePairPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NameValuePairPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs index 9d45543225..87d32ffed1 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceColle /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs deleted file mode 100644 index 7749357a7d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodeCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodeCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs index 950404f602..2e97a43736 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs deleted file mode 100644 index 8978eec33b..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodeDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodeDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs index b3abca814a..08e09d31b1 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdent /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index e520b3dc0e..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodeIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodeIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs index 94f049e176..aca6d06d77 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdent /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs deleted file mode 100644 index d1a8a2d869..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodeIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs index c506d23654..695878109b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLe /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs deleted file mode 100644 index 8a34481ea8..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodePrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodePrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodePrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodePrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs index 6e0bdd0f01..f9ad70bfb3 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLe /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs deleted file mode 100644 index 8b56b30af0..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NodeSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs index c9e095706a..b8d8cacd3f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdent /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs deleted file mode 100644 index d57fc94360..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableNodeIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableNodeIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs index 5b6ff3be7f..9aa239fb6b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLe /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs deleted file mode 100644 index 731da321ac..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableNodeSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableNodeSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableNodeSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs index b35dc4c8a4..de26b64319 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipL /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs deleted file mode 100644 index 6d44e685b7..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableToOneNodeInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NullableToOneNodeInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs index 0f2c061253..e1191fc2b5 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipL /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs deleted file mode 100644 index 2e3b4e6b92..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyNameValuePairInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyNameValuePairInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNameValuePairInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs index 96b0bad961..97042ed6a4 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipL /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs deleted file mode 100644 index 9d67b05215..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyNodeInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToManyNodeInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs index f55d38c1da..68171ebdb0 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipL /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta Meta + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs deleted file mode 100644 index f226b3f806..0000000000 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToOneNodeInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToOneNodeInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ToOneNodeInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs index 44e6388a0e..d5d88584a4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs deleted file mode 100644 index 4e1315fe10..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs index 689246d4e2..6358a6b2f4 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -78,7 +78,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -91,7 +91,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs deleted file mode 100644 index e54bcd4c8a..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs index cea7edd7bd..b700785c3b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs deleted file mode 100644 index ffae42d22a..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamIdentifierCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamIdentifierCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs index 4b8f65dbb0..7be52e4bad 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs deleted file mode 100644 index cfecf2d48b..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs index 19f046ee19..7e91f6a88f 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs deleted file mode 100644 index 6585cf8283..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs index d0df459913..6816adf805 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs deleted file mode 100644 index 66810187ae..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class DataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public DataStreamSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs index 53b7cb571c..c917d7b071 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject.cs @@ -80,16 +80,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Erro /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -170,7 +170,7 @@ public virtual IDictionary> GetFieldDeserializers() { "detail", n => { Detail = n.GetStringValue(); } }, { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, { "status", n => { Status = n.GetStringValue(); } }, { "title", n => { Title = n.GetStringValue(); } }, @@ -187,7 +187,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteStringValue("detail", Detail); writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("source", Source); writer.WriteStringValue("status", Status); writer.WriteStringValue("title", Title); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs index ad524a9bf2..50bb5722fd 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument.cs @@ -51,16 +51,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Erro /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -91,7 +91,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -103,7 +103,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("errors", Errors); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs deleted file mode 100644 index 3c441b928f..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ErrorResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ErrorResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/Meta.cs similarity index 85% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/Meta.cs index f604c56899..4b8502c3a5 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ErrorObject_meta.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/Meta.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class ErrorObject_meta : IAdditionalDataHolder, IBackedModel, IParsable + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. @@ -20,9 +20,9 @@ public IDictionary AdditionalData /// Stores model information. public IBackingStore BackingStore { get; private set; } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ErrorObject_meta() + public Meta() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); AdditionalData = new Dictionary(); @@ -30,12 +30,12 @@ public ErrorObject_meta() /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ErrorObject_meta(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs index 4de66d0786..a5cd66df48 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs deleted file mode 100644 index f816dfc61a..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableDataStreamIdentifierResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableDataStreamIdentifierResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamIdentifierResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs index 252ab6f830..e46cfbb053 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs deleted file mode 100644 index c5cb1d8be2..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamSecondaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableDataStreamSecondaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableDataStreamSecondaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableDataStreamSecondaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs index 9c4378d71b..4bb53e72aa 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Rela /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs deleted file mode 100644 index b1730d4644..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class NullableToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public NullableToOneDataStreamInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.NullableToOneDataStreamInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs index e1c2588804..991c99708b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs deleted file mode 100644 index 00d8b83033..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyChannelCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs index b94e8c407d..ec2e972949 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs deleted file mode 100644 index 075b94a930..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyChannelDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs index eb7cce735a..572962d96b 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs deleted file mode 100644 index 9f7f32c4c6..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyChannelPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs index 4cea8215ba..5d9d0c82c0 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteCollectionOfObjectValues("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs deleted file mode 100644 index 0f55bc910d..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelCollectionResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyResourceChannelCollectionResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyResourceChannelCollectionResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelCollectionResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs index c278405ce3..b08ac619b5 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs deleted file mode 100644 index 418cc2b9c9..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyResourceChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyResourceChannelDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs index f294b2c04d..a3563be5f5 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs deleted file mode 100644 index 360660af73..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ReadOnlyResourceChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ReadOnlyResourceChannelPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs index c9e5da9a23..9fd0406862 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Rela /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs deleted file mode 100644 index bef21bff25..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToManyDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToManyDataStreamInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToManyDataStreamInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs index 5d14a7c8a4..995ac298de 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs @@ -48,16 +48,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Rela /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -88,7 +88,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -100,7 +100,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs deleted file mode 100644 index e54a9497a5..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class ToOneDataStreamInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public ToOneDataStreamInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ToOneDataStreamInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs index 1ec9532116..22c0f919c8 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs @@ -45,16 +45,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -94,7 +94,7 @@ public override IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, }; } @@ -108,7 +108,7 @@ public override void Serialize(ISerializationWriter writer) base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs deleted file mode 100644 index fbce1ee2f3..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class WriteOnlyChannelDataInResponse_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public WriteOnlyChannelDataInResponse_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs index c0bcc35a79..1902dd7544 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument.cs @@ -64,16 +64,16 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Reso /// The meta property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta? Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta? Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta Meta + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta Meta { - get { return BackingStore?.Get("meta"); } + get { return BackingStore?.Get("meta"); } set { BackingStore?.Set("meta", value); } } #endif @@ -105,7 +105,7 @@ public virtual IDictionary> GetFieldDeserializers() { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelDataInResponse.CreateFromDiscriminatorValue); } }, { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, - { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; } /// @@ -118,7 +118,7 @@ public virtual void Serialize(ISerializationWriter writer) writer.WriteObjectValue("data", Data); writer.WriteCollectionOfObjectValues("included", Included); writer.WriteObjectValue("links", Links); - writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("meta", Meta); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs deleted file mode 100644 index 3301d96b9c..0000000000 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelPrimaryResponseDocument_meta.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -using Microsoft.Kiota.Abstractions.Serialization; -using Microsoft.Kiota.Abstractions.Store; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System; -namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models -{ - #pragma warning disable CS1591 - public class WriteOnlyChannelPrimaryResponseDocument_meta : IAdditionalDataHolder, IBackedModel, IParsable - #pragma warning restore CS1591 - { - /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - public IDictionary AdditionalData - { - get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } - set { BackingStore.Set("AdditionalData", value); } - } - /// Stores model information. - public IBackingStore BackingStore { get; private set; } - /// - /// Instantiates a new and sets the default values. - /// - public WriteOnlyChannelPrimaryResponseDocument_meta() - { - BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); - AdditionalData = new Dictionary(); - } - /// - /// Creates a new instance of the appropriate class based on discriminator value - /// - /// A - /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta CreateFromDiscriminatorValue(IParseNode parseNode) - { - _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelPrimaryResponseDocument_meta(); - } - /// - /// The deserialization information for the current model - /// - /// A IDictionary<string, Action<IParseNode>> - public virtual IDictionary> GetFieldDeserializers() - { - return new Dictionary> - { - }; - } - /// - /// Serializes information the current object - /// - /// Serialization writer to use to serialize this model - public virtual void Serialize(ISerializationWriter writer) - { - _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteAdditionalData(AdditionalData); - } - } -} diff --git a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json index 70a6d86b27..764b8cae59 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json @@ -583,9 +583,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -611,11 +613,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -686,11 +688,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -743,11 +745,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -759,6 +761,12 @@ "type": "string", "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "playerAttributesInResponse": { "type": "object", "properties": { @@ -798,11 +806,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -849,11 +857,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -906,11 +914,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -980,11 +988,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1114,11 +1122,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1155,11 +1163,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1196,11 +1204,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json index afa2ecbff0..c37d23c777 100644 --- a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json @@ -1197,11 +1197,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1236,11 +1236,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1276,11 +1276,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1457,9 +1457,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1485,11 +1487,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1563,11 +1565,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1595,11 +1597,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1645,11 +1647,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -1661,6 +1663,12 @@ "type": "string", "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "relationshipLinks": { "type": "object", "properties": { @@ -1803,11 +1811,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json index 2f4d796e38..b86da1816c 100644 --- a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json @@ -5954,11 +5954,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5993,11 +5993,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6040,11 +6040,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6577,9 +6577,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6612,11 +6614,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6710,11 +6712,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6749,11 +6751,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6806,11 +6808,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6844,11 +6846,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6888,11 +6890,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6959,11 +6961,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7040,11 +7042,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7079,11 +7081,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7136,11 +7138,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7180,11 +7182,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7249,15 +7251,21 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullable-flight-attendant-identifier-response-document": { "required": [ "data", @@ -7288,11 +7296,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7333,11 +7341,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7378,11 +7386,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7438,11 +7446,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7470,11 +7478,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7527,11 +7535,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7571,11 +7579,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7855,11 +7863,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7896,11 +7904,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7937,11 +7945,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7980,11 +7988,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json index 2f4d796e38..b86da1816c 100644 --- a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json +++ b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json @@ -5954,11 +5954,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5993,11 +5993,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6040,11 +6040,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6577,9 +6577,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6612,11 +6614,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6710,11 +6712,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6749,11 +6751,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6806,11 +6808,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6844,11 +6846,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6888,11 +6890,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -6959,11 +6961,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7040,11 +7042,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7079,11 +7081,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7136,11 +7138,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7180,11 +7182,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7249,15 +7251,21 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullable-flight-attendant-identifier-response-document": { "required": [ "data", @@ -7288,11 +7296,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7333,11 +7341,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7378,11 +7386,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7438,11 +7446,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7470,11 +7478,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7527,11 +7535,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7571,11 +7579,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7855,11 +7863,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7896,11 +7904,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7937,11 +7945,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -7980,11 +7988,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json index c858eeea55..65e49cc939 100644 --- a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json @@ -3685,11 +3685,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3717,11 +3717,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3768,11 +3768,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3805,11 +3805,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3849,11 +3849,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4310,9 +4310,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4338,11 +4340,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4417,11 +4419,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4449,11 +4451,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4499,11 +4501,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4536,11 +4538,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4552,6 +4554,12 @@ "type": "string", "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableToOneTransportInRequest": { "required": [ "data" @@ -4588,11 +4596,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4620,11 +4628,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4658,11 +4666,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4855,11 +4863,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4898,11 +4906,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4951,11 +4959,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4983,11 +4991,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5040,11 +5048,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5171,11 +5179,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5210,11 +5218,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5250,11 +5258,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json index 398dc6cda2..b9934e3fb5 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json @@ -562,9 +562,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -590,11 +592,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -629,6 +631,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "resourceLinks": { "type": "object", "properties": { @@ -769,11 +777,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -809,11 +817,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json index c6ea2c8078..b35479c1e5 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json @@ -580,9 +580,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -608,11 +610,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -647,6 +649,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "resourceLinks": { "type": "object", "properties": { @@ -796,11 +804,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -836,11 +844,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json index caa16e36d2..2093bc0718 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json @@ -2798,9 +2798,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2833,11 +2835,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2891,15 +2893,21 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableStaffMemberIdentifierResponseDocument": { "required": [ "data", @@ -2930,11 +2938,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2975,11 +2983,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3020,11 +3028,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3232,11 +3240,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3264,11 +3272,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3321,11 +3329,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3359,11 +3367,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3403,11 +3411,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3454,11 +3462,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3513,11 +3521,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3552,11 +3560,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3599,11 +3607,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3682,11 +3690,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3725,11 +3733,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json index cf18edaf55..4aad6ec184 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json @@ -2798,9 +2798,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2833,11 +2835,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2891,15 +2893,21 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullable-staff-member-identifier-response-document": { "required": [ "data", @@ -2930,11 +2938,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2975,11 +2983,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3020,11 +3028,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3232,11 +3240,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3264,11 +3272,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3321,11 +3329,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3359,11 +3367,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3403,11 +3411,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3454,11 +3462,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3513,11 +3521,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3552,11 +3560,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3599,11 +3607,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3682,11 +3690,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3725,11 +3733,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json index 1c8a2cd5c2..94253fd2fa 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json @@ -2798,9 +2798,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -2833,11 +2835,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -2891,15 +2893,21 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false }, + "Meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "NullableStaffMemberIdentifierResponseDocument": { "required": [ "data", @@ -2930,11 +2938,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -2975,11 +2983,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3020,11 +3028,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3232,11 +3240,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3264,11 +3272,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3321,11 +3329,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3359,11 +3367,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3403,11 +3411,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3454,11 +3462,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3513,11 +3521,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3552,11 +3560,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3599,11 +3607,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3682,11 +3690,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false @@ -3725,11 +3733,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json index 6c472a857b..370574a712 100644 --- a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json @@ -3358,9 +3358,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3386,11 +3388,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3425,6 +3427,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nameValuePairAttributesInResponse": { "type": "object", "properties": { @@ -3465,11 +3473,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3504,11 +3512,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3554,11 +3562,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3591,11 +3599,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3660,11 +3668,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3699,11 +3707,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3749,11 +3757,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3780,11 +3788,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3817,11 +3825,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3888,11 +3896,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3920,11 +3928,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3958,11 +3966,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4003,11 +4011,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4226,11 +4234,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4267,11 +4275,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4310,11 +4318,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index 1ffbb52ffd..fce5ed836f 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -2709,11 +2709,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2734,11 +2734,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2784,11 +2784,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2853,9 +2853,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2881,11 +2883,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2920,6 +2922,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableEmptyIdentifierResponseDocument": { "required": [ "data", @@ -2943,11 +2951,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2981,11 +2989,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3026,11 +3034,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3179,11 +3187,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3242,11 +3250,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3333,11 +3341,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3427,11 +3435,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 40053fa6d2..4ac32b40ce 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -2704,11 +2704,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2729,11 +2729,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2779,11 +2779,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2810,11 +2810,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2854,11 +2854,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2916,9 +2916,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2944,11 +2946,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -2983,6 +2985,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableEmptyIdentifierResponseDocument": { "required": [ "data", @@ -3006,11 +3014,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3044,11 +3052,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3089,11 +3097,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3239,11 +3247,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3302,11 +3310,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3393,11 +3401,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3487,11 +3495,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3530,11 +3538,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index 4e13603859..2e6b529e04 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -3556,11 +3556,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3581,11 +3581,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3631,11 +3631,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3662,11 +3662,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3706,11 +3706,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3768,9 +3768,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3796,11 +3798,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3835,6 +3837,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableEmptyIdentifierResponseDocument": { "required": [ "data", @@ -3858,11 +3866,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3896,11 +3904,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3941,11 +3949,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4130,11 +4138,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4193,11 +4201,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4284,11 +4292,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4392,11 +4400,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4435,11 +4443,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 5c8d867f31..8d553fae64 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -3552,11 +3552,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3577,11 +3577,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3627,11 +3627,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3658,11 +3658,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3702,11 +3702,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3764,9 +3764,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3792,11 +3794,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3831,6 +3833,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableEmptyIdentifierResponseDocument": { "required": [ "data", @@ -3854,11 +3862,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3892,11 +3900,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -3937,11 +3945,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4124,11 +4132,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4187,11 +4195,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4278,11 +4286,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4386,11 +4394,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4429,11 +4437,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false diff --git a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json index 00956aebe2..20fa989862 100644 --- a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json @@ -4162,11 +4162,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4194,11 +4194,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4244,11 +4244,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4275,11 +4275,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4312,11 +4312,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4356,11 +4356,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4418,9 +4418,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { }, - "nullable": true + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4446,11 +4448,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4485,6 +4487,12 @@ }, "additionalProperties": false }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, "nullableDataStreamIdentifierResponseDocument": { "required": [ "data", @@ -4508,11 +4516,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4546,11 +4554,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4591,11 +4599,11 @@ "nullable": true }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4645,11 +4653,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4684,11 +4692,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4724,11 +4732,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4805,11 +4813,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4844,11 +4852,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -4884,11 +4892,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5108,11 +5116,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5151,11 +5159,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5224,11 +5232,11 @@ ] }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false @@ -5264,11 +5272,11 @@ } }, "meta": { - "type": "object", - "additionalProperties": { - "type": "object", - "nullable": true - } + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] } }, "additionalProperties": false From 6178c58cd15e89276548e4f84b3febc6bb87eab5 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:10:32 +0200 Subject: [PATCH 4/7] Cleanup allOf wrapping/unwrapping --- .../JsonApiDotNetCoreExample.json | 54 ++++++++++++--- .../OpenApiSchemaExtensions.cs | 18 +++-- .../DocumentSchemaGenerator.cs | 6 +- .../LinksVisibilitySchemaGenerator.cs | 4 +- .../ResourceDataSchemaGenerator.cs | 10 +-- .../ResourceFieldSchemaBuilder.cs | 20 ++---- .../ResourceIdentifierSchemaGenerator.cs | 3 +- .../GeneratedSwagger/swagger.g.json | 36 ++++++++-- .../Headers/GeneratedSwagger/swagger.g.json | 18 ++++- .../GeneratedSwagger/swagger.g.json | 66 +++++++++++++++---- .../LegacyOpenApi/expected-swagger.json | 66 +++++++++++++++---- .../Enabled/GeneratedSwagger/swagger.g.json | 66 +++++++++++++++---- .../GeneratedSwagger/net6.0/swagger.g.json | 12 +++- .../GeneratedSwagger/net8.0/swagger.g.json | 12 +++- .../CamelCase/CamelCaseTests.cs | 4 +- .../CamelCase/GeneratedSwagger/swagger.g.json | 30 +++++++-- .../KebabCase/GeneratedSwagger/swagger.g.json | 30 +++++++-- .../KebabCase/KebabCaseTests.cs | 4 +- .../GeneratedSwagger/swagger.g.json | 30 +++++++-- .../PascalCase/PascalCaseTests.cs | 4 +- .../GeneratedSwagger/swagger.g.json | 36 ++++++++-- .../GeneratedSwagger/swagger.g.json | 18 ++++- .../GeneratedSwagger/swagger.g.json | 18 ++++- .../GeneratedSwagger/swagger.g.json | 18 ++++- .../GeneratedSwagger/swagger.g.json | 18 ++++- .../GeneratedSwagger/swagger.g.json | 18 ++++- 26 files changed, 492 insertions(+), 127 deletions(-) diff --git a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json index 674080b3a9..e0129c0d83 100644 --- a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json +++ b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json @@ -4895,7 +4895,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/personResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/personResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4921,7 +4925,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/tagResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/tagResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4947,7 +4955,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/todoItemResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] }, "attributes": { "allOf": [ @@ -5001,7 +5013,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/personResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/personResourceType" + } + ] }, "id": { "minLength": 1, @@ -5032,7 +5048,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/tagResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/tagResourceType" + } + ] }, "id": { "minLength": 1, @@ -5063,7 +5083,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/todoItemResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] }, "id": { "minLength": 1, @@ -5432,7 +5456,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/personResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/personResourceType" + } + ] }, "id": { "minLength": 1, @@ -5891,7 +5919,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/tagResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/tagResourceType" + } + ] }, "id": { "minLength": 1, @@ -6228,7 +6260,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/todoItemResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs index ac1739487b..5390733042 100644 --- a/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiSchemaExtensions.cs @@ -27,15 +27,25 @@ public static void ReorderProperties(this OpenApiSchema fullSchema, IEnumerable< fullSchema.Properties = propertiesInOrder; } - public static OpenApiSchema UnwrapExtendedReferenceSchema(this OpenApiSchema source) + public static OpenApiSchema WrapInExtendedSchema(this OpenApiSchema source) { ArgumentGuard.NotNull(source); - if (source.AllOf.Count != 1) + return new OpenApiSchema { - throw new InvalidOperationException($"Schema '{nameof(source)}' should not contain multiple entries in '{nameof(source.AllOf)}' "); + AllOf = [source] + }; + } + + public static OpenApiSchema UnwrapLastExtendedSchema(this OpenApiSchema source) + { + ArgumentGuard.NotNull(source); + + if (source.AllOf is { Count: > 0 }) + { + return source.AllOf.Last(); } - return source.AllOf.Single(); + return source; } } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs index 91386e8642..e761f9ff2c 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs @@ -75,11 +75,7 @@ private void GenerateErrorObjectSchema(SchemaRepository schemaRepository) OpenApiSchema fullSchemaForErrorObject = schemaRepository.Schemas[referenceSchemaForErrorObject.Reference.Id]; OpenApiSchema referenceSchemaForMeta = _metaSchemaGenerator.GenerateSchema(schemaRepository); - - fullSchemaForErrorObject.Properties[JsonApiPropertyName.Meta] = new OpenApiSchema - { - AllOf = [referenceSchemaForMeta] - }; + fullSchemaForErrorObject.Properties[JsonApiPropertyName.Meta] = referenceSchemaForMeta.WrapInExtendedSchema(); } private OpenApiSchema GenerateJsonApiDocumentSchema(Type documentType, SchemaRepository schemaRepository) diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs index c1bdcf33ae..2820a1aaef 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs @@ -115,8 +115,8 @@ private void UpdateLinksProperty(OpenApiSchema fullSchemaForLinksContainer, Link } else if (visibleLinkTypes != possibleLinkTypes) { - OpenApiSchema referenceSchemaForLinks = fullSchemaForLinksContainer.Properties[JsonApiPropertyName.Links]; - string linksSchemaId = referenceSchemaForLinks.AllOf[0].Reference.Id; + OpenApiSchema referenceSchemaForLinks = fullSchemaForLinksContainer.Properties[JsonApiPropertyName.Links].UnwrapLastExtendedSchema(); + string linksSchemaId = referenceSchemaForLinks.Reference.Id; if (schemaRepository.Schemas.TryGetValue(linksSchemaId, out OpenApiSchema? fullSchemaForLinks)) { diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs index 2479e817b7..2343ce9482 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs @@ -75,8 +75,7 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo var fieldSchemaBuilder = new ResourceFieldSchemaBuilder(_defaultSchemaGenerator, _resourceIdentifierSchemaGenerator, _linksVisibilitySchemaGenerator, _resourceFieldValidationMetadataProvider, _relationshipTypeFactory, resourceTypeInfo); - OpenApiSchema effectiveFullSchemaForResourceData = - fullSchemaForResourceData.AllOf.Count == 0 ? fullSchemaForResourceData : fullSchemaForResourceData.AllOf[1]; + OpenApiSchema effectiveFullSchemaForResourceData = fullSchemaForResourceData.UnwrapLastExtendedSchema(); if (effectiveFullSchemaForResourceData == fullSchemaForResourceData) { @@ -118,12 +117,13 @@ private void AdaptResourceIdentity(ResourceTypeInfo resourceTypeInfo, OpenApiSch private void SetResourceType(OpenApiSchema fullSchemaForResourceData, ResourceType resourceType, SchemaRepository schemaRepository) { - fullSchemaForResourceData.Properties[JsonApiPropertyName.Type] = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + OpenApiSchema referenceSchema = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + fullSchemaForResourceData.Properties[JsonApiPropertyName.Type] = referenceSchema.WrapInExtendedSchema(); } private void SetResourceAttributes(OpenApiSchema fullSchemaForResourceData, ResourceFieldSchemaBuilder builder, SchemaRepository schemaRepository) { - OpenApiSchema referenceSchemaForAttributes = fullSchemaForResourceData.Properties[JsonApiPropertyName.Attributes].UnwrapExtendedReferenceSchema(); + OpenApiSchema referenceSchemaForAttributes = fullSchemaForResourceData.Properties[JsonApiPropertyName.Attributes].UnwrapLastExtendedSchema(); OpenApiSchema fullSchemaForAttributes = schemaRepository.Schemas[referenceSchemaForAttributes.Reference.Id]; builder.SetMembersOfAttributes(fullSchemaForAttributes, schemaRepository); @@ -140,7 +140,7 @@ private void SetResourceAttributes(OpenApiSchema fullSchemaForResourceData, Reso private void SetResourceRelationships(OpenApiSchema fullSchemaForResourceData, ResourceFieldSchemaBuilder builder, SchemaRepository schemaRepository) { - OpenApiSchema referenceSchemaForRelationships = fullSchemaForResourceData.Properties[JsonApiPropertyName.Relationships].UnwrapExtendedReferenceSchema(); + OpenApiSchema referenceSchemaForRelationships = fullSchemaForResourceData.Properties[JsonApiPropertyName.Relationships].UnwrapLastExtendedSchema(); OpenApiSchema fullSchemaForRelationships = schemaRepository.Schemas[referenceSchemaForRelationships.Reference.Id]; builder.SetMembersOfRelationships(fullSchemaForRelationships, schemaRepository); diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs index c8bf0262ed..012e791be1 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs @@ -66,12 +66,12 @@ public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, Schema if (matchingAttribute != null && matchingAttribute.Capabilities.HasFlag(requiredCapability)) { - bool isPrimitiveOpenApiType = resourceFieldSchema.AllOf.IsNullOrEmpty(); + bool isInlineSchemaType = resourceFieldSchema.AllOf.Count == 0; - // Types like enum and complex attributes are not primitive and handled as reference schemas. - if (!isPrimitiveOpenApiType) + // Schemas for types like enum and complex attributes are handled as reference schemas. + if (!isInlineSchemaType) { - EnsureAttributeSchemaIsExposed(resourceFieldSchema, matchingAttribute, schemaRepository); + EnsureAttributeSchemaIsExposed(resourceFieldSchema.UnwrapLastExtendedSchema(), matchingAttribute, schemaRepository); } fullSchemaForAttributes.Properties[matchingAttribute.PublicName] = resourceFieldSchema; @@ -104,7 +104,7 @@ private void EnsureAttributeSchemaIsExposed(OpenApiSchema attributeReferenceSche return; } - string schemaId = attributeReferenceSchema.UnwrapExtendedReferenceSchema().Reference.Id; + string schemaId = attributeReferenceSchema.Reference.Id; OpenApiSchema fullSchema = _resourceSchemaRepository.Schemas[schemaId]; schemaRepository.AddDefinition(schemaId, fullSchema); @@ -156,14 +156,8 @@ private void AddRelationshipSchemaToResourceData(RelationshipAttribute relations OpenApiSchema referenceSchemaForRelationship = GetReferenceSchemaForRelationship(relationshipSchemaType, schemaRepository) ?? CreateRelationshipReferenceSchema(relationshipSchemaType, schemaRepository); - var extendedReferenceSchemaForRelationship = new OpenApiSchema - { - AllOf = new List - { - referenceSchemaForRelationship - }, - Description = _resourceDocumentationReader.GetDocumentationForRelationship(relationship) - }; + OpenApiSchema extendedReferenceSchemaForRelationship = referenceSchemaForRelationship.WrapInExtendedSchema(); + extendedReferenceSchemaForRelationship.Description = _resourceDocumentationReader.GetDocumentationForRelationship(relationship); fullSchemaForRelationships.Properties.Add(relationship.PublicName, extendedReferenceSchemaForRelationship); diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs index f17b0e0f3c..5c900fc6b2 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs @@ -31,7 +31,8 @@ public OpenApiSchema GenerateSchema(ResourceType resourceType, SchemaRepository referenceSchemaForIdentifier = _defaultSchemaGenerator.GenerateSchema(resourceIdentifierConstructedType, schemaRepository); OpenApiSchema fullSchemaForIdentifier = schemaRepository.Schemas[referenceSchemaForIdentifier.Reference.Id]; - fullSchemaForIdentifier.Properties[JsonApiPropertyName.Type] = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + OpenApiSchema referenceSchemaForResourceType = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + fullSchemaForIdentifier.Properties[JsonApiPropertyName.Type] = referenceSchemaForResourceType.WrapInExtendedSchema(); } return referenceSchemaForIdentifier; diff --git a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json index 764b8cae59..d80da35899 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json @@ -430,7 +430,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/gameResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/gameResourceType" + } + ] }, "id": { "minLength": 1, @@ -453,7 +457,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/playerGroupResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/playerGroupResourceType" + } + ] }, "attributes": { "allOf": [ @@ -480,7 +488,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/playerResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/playerResourceType" + } + ] }, "id": { "minLength": 1, @@ -708,7 +720,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/gameResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/gameResourceType" + } + ] }, "id": { "minLength": 1, @@ -877,7 +893,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/playerGroupResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/playerGroupResourceType" + } + ] }, "id": { "minLength": 1, @@ -951,7 +971,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/playerResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/playerResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json index c37d23c777..6dca80592f 100644 --- a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json @@ -1328,7 +1328,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/countryResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/countryResourceType" + } + ] }, "attributes": { "allOf": [ @@ -1381,7 +1385,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/countryResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/countryResourceType" + } + ] }, "id": { "minLength": 1, @@ -1617,7 +1625,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/languageResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/languageResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json index b86da1816c..bd688df03f 100644 --- a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json @@ -6296,7 +6296,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/airplane-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6322,7 +6326,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6348,7 +6356,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "relationships": { "allOf": [ @@ -6367,7 +6379,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6415,7 +6431,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/airplane-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6446,7 +6466,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6477,7 +6501,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6508,7 +6536,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6771,7 +6803,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "id": { "minLength": 1, @@ -7101,7 +7137,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "id": { "minLength": 1, @@ -7498,7 +7538,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json index b86da1816c..bd688df03f 100644 --- a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json +++ b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json @@ -6296,7 +6296,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/airplane-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6322,7 +6326,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6348,7 +6356,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "relationships": { "allOf": [ @@ -6367,7 +6379,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -6415,7 +6431,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/airplane-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/airplane-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6446,7 +6466,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6477,7 +6501,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6508,7 +6536,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "id": { "minLength": 1, @@ -6771,7 +6803,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-attendant-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] }, "id": { "minLength": 1, @@ -7101,7 +7137,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/flight-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] }, "id": { "minLength": 1, @@ -7498,7 +7538,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/passenger-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json index 65e49cc939..2cc51547c4 100644 --- a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json @@ -3737,7 +3737,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/accommodationResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/accommodationResourceType" + } + ] }, "id": { "minLength": 1, @@ -4050,7 +4054,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/accommodationResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/accommodationResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4069,7 +4077,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/excursionResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/excursionResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4088,7 +4100,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/transportResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/transportResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4107,7 +4123,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/vacationResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/vacationResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4162,7 +4182,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/accommodationResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/accommodationResourceType" + } + ] }, "id": { "minLength": 1, @@ -4186,7 +4210,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/excursionResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/excursionResourceType" + } + ] }, "id": { "minLength": 1, @@ -4210,7 +4238,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/transportResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/transportResourceType" + } + ] }, "id": { "minLength": 1, @@ -4234,7 +4266,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/vacationResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/vacationResourceType" + } + ] }, "id": { "minLength": 1, @@ -4471,7 +4507,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/excursionResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/excursionResourceType" + } + ] }, "id": { "minLength": 1, @@ -5011,7 +5051,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/transportResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/transportResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json index b9934e3fb5..a75539036b 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json @@ -448,7 +448,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + } + ] }, "attributes": { "allOf": [ @@ -493,7 +497,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json index b35479c1e5..4590d6c75d 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json @@ -466,7 +466,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + } + ] }, "attributes": { "allOf": [ @@ -511,7 +515,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/socialMediaAccountResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/socialMediaAccountResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs index 706ad47ba2..d2b882cd2c 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs @@ -138,8 +138,8 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() schemasElement.Should().ContainPath($"{relatedResourceIdentifierSchemaRefId}.properties").With(propertiesElement => { - relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.$ref").ShouldBeSchemaReferenceId("staffMemberResourceType") - .SchemaReferenceId; + relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.allOf[0].$ref") + .ShouldBeSchemaReferenceId("staffMemberResourceType").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => diff --git a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json index 2093bc0718..daf63bf136 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json @@ -2626,7 +2626,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2645,7 +2649,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/supermarketResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2698,7 +2706,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberResourceType" + } + ] }, "id": { "minLength": 1, @@ -2722,7 +2734,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/supermarketResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] }, "id": { "minLength": 1, @@ -3292,7 +3308,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json index 4aad6ec184..c98b0c40b4 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json @@ -2626,7 +2626,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staff-member-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -2645,7 +2649,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/supermarket-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] }, "attributes": { "allOf": [ @@ -2698,7 +2706,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staff-member-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-resource-type" + } + ] }, "id": { "minLength": 1, @@ -2722,7 +2734,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/supermarket-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] }, "id": { "minLength": 1, @@ -3292,7 +3308,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/staff-member-resource-type" + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-resource-type" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs index 7d9a950163..f3b3b8f7a0 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs @@ -138,8 +138,8 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() schemasElement.Should().ContainPath($"{relatedResourceIdentifierSchemaRefId}.properties").With(propertiesElement => { - relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.$ref").ShouldBeSchemaReferenceId("staff-member-resource-type") - .SchemaReferenceId; + relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.allOf[0].$ref") + .ShouldBeSchemaReferenceId("staff-member-resource-type").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => diff --git a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json index 94253fd2fa..67d02bf10a 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json @@ -2626,7 +2626,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/StaffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2645,7 +2649,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/SupermarketResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2698,7 +2706,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/StaffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberResourceType" + } + ] }, "id": { "minLength": 1, @@ -2722,7 +2734,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/SupermarketResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] }, "id": { "minLength": 1, @@ -3292,7 +3308,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/StaffMemberResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs index 262fc025e1..91029eb271 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs @@ -138,8 +138,8 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() schemasElement.Should().ContainPath($"{relatedResourceIdentifierSchemaRefId}.properties").With(propertiesElement => { - relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.$ref").ShouldBeSchemaReferenceId("StaffMemberResourceType") - .SchemaReferenceId; + relatedResourceTypeSchemaRefId = propertiesElement.Should().ContainPath("type.allOf[0].$ref") + .ShouldBeSchemaReferenceId("StaffMemberResourceType").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relatedResourceTypeSchemaRefId}.enum").With(codeElement => diff --git a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json index 370574a712..fdd3b0cac8 100644 --- a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json @@ -3172,7 +3172,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nameValuePairResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nameValuePairResourceType" + } + ] }, "attributes": { "allOf": [ @@ -3198,7 +3202,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nodeResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nodeResourceType" + } + ] }, "attributes": { "allOf": [ @@ -3251,7 +3259,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nameValuePairResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nameValuePairResourceType" + } + ] }, "id": { "minLength": 1, @@ -3282,7 +3294,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nodeResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nodeResourceType" + } + ] }, "id": { "minLength": 1, @@ -3532,7 +3548,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nameValuePairResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nameValuePairResourceType" + } + ] }, "id": { "minLength": 1, @@ -3727,7 +3747,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/nodeResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/nodeResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index fce5ed836f..7f7aa014bb 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -2606,7 +2606,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2659,7 +2663,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "id": { "minLength": 1, @@ -2754,7 +2762,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/emptyResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/emptyResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 4ac32b40ce..332362db65 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -2601,7 +2601,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "attributes": { "allOf": [ @@ -2654,7 +2658,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "id": { "minLength": 1, @@ -2749,7 +2757,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/emptyResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/emptyResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index 2e6b529e04..ad419cec82 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -3453,7 +3453,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "attributes": { "allOf": [ @@ -3506,7 +3510,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "id": { "minLength": 1, @@ -3601,7 +3609,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/emptyResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/emptyResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 8d553fae64..a4326b97c9 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -3449,7 +3449,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "attributes": { "allOf": [ @@ -3502,7 +3506,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/resourceResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/resourceResourceType" + } + ] }, "id": { "minLength": 1, @@ -3597,7 +3605,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/emptyResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/emptyResourceType" + } + ] }, "id": { "minLength": 1, diff --git a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json index 20fa989862..e385148aa7 100644 --- a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json @@ -4047,7 +4047,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/writeOnlyChannelResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/writeOnlyChannelResourceType" + } + ] }, "attributes": { "allOf": [ @@ -4102,7 +4106,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/writeOnlyChannelResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/writeOnlyChannelResourceType" + } + ] }, "id": { "minLength": 1, @@ -4214,7 +4222,11 @@ "type": "object", "properties": { "type": { - "$ref": "#/components/schemas/dataStreamResourceType" + "allOf": [ + { + "$ref": "#/components/schemas/dataStreamResourceType" + } + ] }, "id": { "minLength": 1, From 8e1d16d53100103e06e49275689da0869bc47dca Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:20:56 +0200 Subject: [PATCH 5/7] Unify method names in schema generators, move into subdirectory, split document generators --- .../JsonApiRequestFormatMetadataProvider.cs | 1 - .../JsonApiSchemaFacts.cs | 22 +-- .../Bodies/BodySchemaGenerator.cs | 62 +++++++ .../ErrorResponseBodySchemaGenerator.cs | 43 +++++ ...sourceOrRelationshipBodySchemaGenerator.cs | 152 +++++++++++++++++ .../AbstractResourceDataSchemaGenerator.cs | 16 +- .../Components/DataSchemaGenerator.cs} | 34 ++-- .../LinksVisibilitySchemaGenerator.cs | 3 +- .../Components}/MetaSchemaGenerator.cs | 2 +- .../ResourceIdentifierSchemaGenerator.cs | 4 +- .../ResourceTypeSchemaGenerator.cs | 20 +-- .../JsonApiSchemaGenerator.cs | 67 ++++++++ .../ServiceCollectionExtensions.cs | 9 +- .../DocumentSchemaGenerator.cs | 157 ------------------ .../JsonApiSchemaGenerator.cs | 63 ------- .../ResourceFieldSchemaBuilder.cs | 10 +- 16 files changed, 371 insertions(+), 294 deletions(-) rename src/JsonApiDotNetCore.OpenApi/{JsonApiObjects => }/JsonApiSchemaFacts.cs (66%) create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/BodySchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ErrorResponseBodySchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents => SchemaGenerators/Components}/AbstractResourceDataSchemaGenerator.cs (89%) rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents/ResourceDataSchemaGenerator.cs => SchemaGenerators/Components/DataSchemaGenerator.cs} (86%) rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents => SchemaGenerators/Components}/LinksVisibilitySchemaGenerator.cs (98%) rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents => SchemaGenerators/Components}/MetaSchemaGenerator.cs (94%) rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents => SchemaGenerators/Components}/ResourceIdentifierSchemaGenerator.cs (92%) rename src/JsonApiDotNetCore.OpenApi/{SwaggerComponents => SchemaGenerators/Components}/ResourceTypeSchemaGenerator.cs (65%) create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/JsonApiSchemaGenerator.cs delete mode 100644 src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs delete mode 100644 src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiSchemaGenerator.cs diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs index 4f2a1edd53..29d46d6d9e 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs @@ -1,5 +1,4 @@ using JsonApiDotNetCore.Middleware; -using JsonApiDotNetCore.OpenApi.JsonApiObjects; using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Net.Http.Headers; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs similarity index 66% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs index 5e8f19978f..20b3377815 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/JsonApiSchemaFacts.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs @@ -3,7 +3,7 @@ #pragma warning disable AV1008 // Class should not be static -namespace JsonApiDotNetCore.OpenApi.JsonApiObjects; +namespace JsonApiDotNetCore.OpenApi; internal static class JsonApiSchemaFacts { @@ -16,18 +16,6 @@ internal static class JsonApiSchemaFacts typeof(ToManyRelationshipInRequest<>) ]; - private static readonly Type[] ResponseSchemaTypes = - [ - typeof(ResourceCollectionResponseDocument<>), - typeof(PrimaryResourceResponseDocument<>), - typeof(SecondaryResourceResponseDocument<>), - typeof(NullableSecondaryResourceResponseDocument<>), - typeof(ResourceIdentifierCollectionResponseDocument<>), - typeof(ResourceIdentifierResponseDocument<>), - typeof(NullableResourceIdentifierResponseDocument<>), - typeof(ErrorResponseDocument) - ]; - private static readonly Type[] SchemaTypesHavingNullableDataProperty = [ typeof(NullableSecondaryResourceResponseDocument<>), @@ -43,14 +31,6 @@ internal static class JsonApiSchemaFacts typeof(NullableToOneRelationshipInResponse<>) ]; - public static bool RequiresCustomSchemaGenerator(Type schemaType) - { - // Subset of the entry types Swashbuckle calls us for, which must be handled by our custom schema generators. - - Type lookupType = schemaType.ConstructedToOpenType(); - return RequestSchemaTypes.Contains(lookupType) || ResponseSchemaTypes.Contains(lookupType); - } - public static bool IsRequestSchemaType(Type schemaType) { Type lookupType = schemaType.ConstructedToOpenType(); diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/BodySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/BodySchemaGenerator.cs new file mode 100644 index 0000000000..f14f635ad1 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/BodySchemaGenerator.cs @@ -0,0 +1,62 @@ +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; + +/// +/// Generates the OpenAPI component schema for a request and/or response body. +/// +internal abstract class BodySchemaGenerator +{ + private readonly MetaSchemaGenerator _metaSchemaGenerator; + private readonly LinksVisibilitySchemaGenerator _linksVisibilitySchemaGenerator; + private readonly IJsonApiOptions _options; + + protected BodySchemaGenerator(MetaSchemaGenerator metaSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, + IJsonApiOptions options) + { + ArgumentGuard.NotNull(metaSchemaGenerator); + ArgumentGuard.NotNull(linksVisibilitySchemaGenerator); + ArgumentGuard.NotNull(options); + + _metaSchemaGenerator = metaSchemaGenerator; + _linksVisibilitySchemaGenerator = linksVisibilitySchemaGenerator; + _options = options; + } + + public abstract bool CanGenerate(Type modelType); + + public OpenApiSchema GenerateSchema(Type bodyType, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(bodyType); + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.TryLookupByType(bodyType, out OpenApiSchema? referenceSchema)) + { + return referenceSchema; + } + + _metaSchemaGenerator.GenerateSchema(schemaRepository); + + referenceSchema = GenerateBodySchema(bodyType, schemaRepository); + OpenApiSchema fullSchema = schemaRepository.Schemas[referenceSchema.Reference.Id]; + + _linksVisibilitySchemaGenerator.UpdateSchemaForTopLevel(bodyType, fullSchema, schemaRepository); + + SetJsonApiVersion(fullSchema); + + return referenceSchema; + } + + protected abstract OpenApiSchema GenerateBodySchema(Type bodyType, SchemaRepository schemaRepository); + + private void SetJsonApiVersion(OpenApiSchema fullSchema) + { + if (fullSchema.Properties.ContainsKey(JsonApiPropertyName.Jsonapi) && !_options.IncludeJsonApiVersion) + { + fullSchema.Properties.Remove(JsonApiPropertyName.Jsonapi); + } + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ErrorResponseBodySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ErrorResponseBodySchemaGenerator.cs new file mode 100644 index 0000000000..4f33d4700b --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ErrorResponseBodySchemaGenerator.cs @@ -0,0 +1,43 @@ +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; +using JsonApiDotNetCore.Serialization.Objects; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; + +/// +/// Generates the OpenAPI component schema for an error document. +/// +internal sealed class ErrorResponseBodySchemaGenerator : BodySchemaGenerator +{ + private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly MetaSchemaGenerator _metaSchemaGenerator; + + public ErrorResponseBodySchemaGenerator(SchemaGenerator defaultSchemaGenerator, MetaSchemaGenerator metaSchemaGenerator, + LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IJsonApiOptions options) + : base(metaSchemaGenerator, linksVisibilitySchemaGenerator, options) + { + ArgumentGuard.NotNull(defaultSchemaGenerator); + + _defaultSchemaGenerator = defaultSchemaGenerator; + _metaSchemaGenerator = metaSchemaGenerator; + } + + public override bool CanGenerate(Type modelType) + { + return modelType == typeof(ErrorResponseDocument); + } + + protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaRepository schemaRepository) + { + OpenApiSchema referenceSchemaForErrorObject = _defaultSchemaGenerator.GenerateSchema(typeof(ErrorObject), schemaRepository); + OpenApiSchema fullSchemaForErrorObject = schemaRepository.Schemas[referenceSchemaForErrorObject.Reference.Id]; + + OpenApiSchema referenceSchemaForMeta = _metaSchemaGenerator.GenerateSchema(schemaRepository); + fullSchemaForErrorObject.Properties[JsonApiPropertyName.Meta] = referenceSchemaForMeta.WrapInExtendedSchema(); + + return _defaultSchemaGenerator.GenerateSchema(bodyType, schemaRepository); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs new file mode 100644 index 0000000000..6e735e6cb7 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs @@ -0,0 +1,152 @@ +using System.Reflection; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Relationships; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; +using JsonApiDotNetCore.OpenApi.SwaggerComponents; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; + +/// +/// Generates the OpenAPI component schema for a resource/relationship request/response body. +/// +internal sealed class ResourceOrRelationshipBodySchemaGenerator : BodySchemaGenerator +{ + private static readonly Type[] RequestSchemaTypes = + [ + typeof(CreateResourceRequestDocument<>), + typeof(UpdateResourceRequestDocument<>), + typeof(ToOneRelationshipInRequest<>), + typeof(NullableToOneRelationshipInRequest<>), + typeof(ToManyRelationshipInRequest<>) + ]; + + private static readonly Type[] ResponseSchemaTypes = + [ + typeof(ResourceCollectionResponseDocument<>), + typeof(PrimaryResourceResponseDocument<>), + typeof(SecondaryResourceResponseDocument<>), + typeof(NullableSecondaryResourceResponseDocument<>), + typeof(ResourceIdentifierResponseDocument<>), + typeof(NullableResourceIdentifierResponseDocument<>), + typeof(ResourceIdentifierCollectionResponseDocument<>) + ]; + + private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly AbstractResourceDataSchemaGenerator _abstractResourceDataSchemaGenerator; + private readonly DataSchemaGenerator _dataSchemaGenerator; + private readonly IncludeDependencyScanner _includeDependencyScanner; + private readonly IResourceGraph _resourceGraph; + + public ResourceOrRelationshipBodySchemaGenerator(SchemaGenerator defaultSchemaGenerator, + AbstractResourceDataSchemaGenerator abstractResourceDataSchemaGenerator, DataSchemaGenerator dataSchemaGenerator, + MetaSchemaGenerator metaSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, + IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph, IJsonApiOptions options) + : base(metaSchemaGenerator, linksVisibilitySchemaGenerator, options) + { + ArgumentGuard.NotNull(defaultSchemaGenerator); + ArgumentGuard.NotNull(abstractResourceDataSchemaGenerator); + ArgumentGuard.NotNull(dataSchemaGenerator); + ArgumentGuard.NotNull(includeDependencyScanner); + ArgumentGuard.NotNull(resourceGraph); + + _defaultSchemaGenerator = defaultSchemaGenerator; + _abstractResourceDataSchemaGenerator = abstractResourceDataSchemaGenerator; + _dataSchemaGenerator = dataSchemaGenerator; + _includeDependencyScanner = includeDependencyScanner; + _resourceGraph = resourceGraph; + } + + public override bool CanGenerate(Type modelType) + { + Type modelOpenType = modelType.ConstructedToOpenType(); + return RequestSchemaTypes.Contains(modelOpenType) || ResponseSchemaTypes.Contains(modelOpenType); + } + + protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(bodyType); + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.TryLookupByType(bodyType, out OpenApiSchema? referenceSchemaForBody)) + { + return referenceSchemaForBody; + } + + bool isRequestSchema = RequestSchemaTypes.Contains(bodyType.ConstructedToOpenType()); + + if (!isRequestSchema) + { + // There's no way to intercept in the Swashbuckle recursive component schema generation when using inheritance, which we need + // to perform generic type expansions. As a workaround, we generate an empty base schema upfront. Each time the schema + // for a derived type is generated, we'll add it to the discriminator mapping. + _ = _abstractResourceDataSchemaGenerator.GenerateSchema(schemaRepository); + } + + Type dataConstructedType = GetInnerTypeOfDataProperty(bodyType); + + if (!isRequestSchema) + { + // Ensure all reachable related resource types are available in the discriminator mapping so includes work. + // Doing this matters when not all endpoints are exposed. + EnsureResourceTypesAreMappedInDiscriminator(dataConstructedType, schemaRepository); + } + + OpenApiSchema referenceSchemaForData = _dataSchemaGenerator.GenerateSchema(dataConstructedType, schemaRepository); + + if (!isRequestSchema) + { + _abstractResourceDataSchemaGenerator.MapDiscriminator(dataConstructedType, referenceSchemaForData, schemaRepository); + } + + referenceSchemaForBody = _defaultSchemaGenerator.GenerateSchema(bodyType, schemaRepository); + OpenApiSchema fullSchemaForBody = schemaRepository.Schemas[referenceSchemaForBody.Reference.Id].UnwrapLastExtendedSchema(); + + if (JsonApiSchemaFacts.HasNullableDataProperty(bodyType)) + { + fullSchemaForBody.Properties[JsonApiPropertyName.Data].Nullable = true; + } + + return referenceSchemaForBody; + } + + private static Type GetInnerTypeOfDataProperty(Type bodyType) + { + PropertyInfo? dataProperty = bodyType.GetProperty("Data"); + + if (dataProperty == null) + { + throw new UnreachableCodeException(); + } + + return dataProperty.PropertyType.ConstructedToOpenType().IsAssignableTo(typeof(ICollection<>)) + ? dataProperty.PropertyType.GenericTypeArguments[0] + : dataProperty.PropertyType; + } + + private void EnsureResourceTypesAreMappedInDiscriminator(Type dataConstructedType, SchemaRepository schemaRepository) + { + Type dataOpenType = dataConstructedType.GetGenericTypeDefinition(); + + if (dataOpenType == typeof(ResourceDataInResponse<>)) + { + var resourceTypeInfo = ResourceTypeInfo.Create(dataConstructedType, _resourceGraph); + + foreach (ResourceType resourceType in _includeDependencyScanner.GetReachableRelatedTypes(resourceTypeInfo.ResourceType)) + { + EnsureResourceTypeIsMappedInDiscriminator(schemaRepository, resourceType); + } + } + } + + private void EnsureResourceTypeIsMappedInDiscriminator(SchemaRepository schemaRepository, ResourceType resourceType) + { + Type resourceDataConstructedType = typeof(ResourceDataInResponse<>).MakeGenericType(resourceType.ClrType); + OpenApiSchema referenceSchemaForResourceData = _dataSchemaGenerator.GenerateSchema(resourceDataConstructedType, schemaRepository); + + _abstractResourceDataSchemaGenerator.MapDiscriminator(resourceDataConstructedType, referenceSchemaForResourceData, schemaRepository); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/AbstractResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs similarity index 89% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/AbstractResourceDataSchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs index 09a2e67442..fca728697a 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/AbstractResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs @@ -1,11 +1,12 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SwaggerComponents; using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; internal sealed class AbstractResourceDataSchemaGenerator { @@ -23,7 +24,7 @@ public AbstractResourceDataSchemaGenerator(JsonApiSchemaIdSelector schemaIdSelec _resourceGraph = resourceGraph; } - public OpenApiSchema Get(SchemaRepository schemaRepository) + public OpenApiSchema GenerateSchema(SchemaRepository schemaRepository) { ArgumentGuard.NotNull(schemaRepository); @@ -67,16 +68,7 @@ public OpenApiSchema Get(SchemaRepository schemaRepository) string schemaId = _schemaIdSelector.GetSchemaId(ResourceDataAbstractType); - referenceSchema = new OpenApiSchema - { - Reference = new OpenApiReference - { - Id = schemaId, - Type = ReferenceType.Schema - } - }; - - schemaRepository.AddDefinition(schemaId, fullSchema); + referenceSchema = schemaRepository.AddDefinition(schemaId, fullSchema); schemaRepository.RegisterType(ResourceDataAbstractType, schemaId); return referenceSchema; diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs similarity index 86% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs index 2343ce9482..3f92747370 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs @@ -1,12 +1,13 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.OpenApi.JsonApiMetadata; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SwaggerComponents; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; -internal sealed class ResourceDataSchemaGenerator +internal sealed class DataSchemaGenerator { #if NET6_0 private static readonly string[] ResourceDataPropertyNamesInOrder = @@ -30,7 +31,7 @@ internal sealed class ResourceDataSchemaGenerator private readonly RelationshipTypeFactory _relationshipTypeFactory; private readonly ResourceDocumentationReader _resourceDocumentationReader; - public ResourceDataSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeSchemaGenerator resourceTypeSchemaGenerator, + public DataSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeSchemaGenerator resourceTypeSchemaGenerator, ResourceIdentifierSchemaGenerator resourceIdentifierSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IResourceGraph resourceGraph, IJsonApiOptions options, ResourceFieldValidationMetadataProvider resourceFieldValidationMetadataProvider, RelationshipTypeFactory relationshipTypeFactory, ResourceDocumentationReader resourceDocumentationReader) @@ -72,12 +73,9 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo var resourceTypeInfo = ResourceTypeInfo.Create(resourceDataConstructedType, _resourceGraph); - var fieldSchemaBuilder = new ResourceFieldSchemaBuilder(_defaultSchemaGenerator, _resourceIdentifierSchemaGenerator, _linksVisibilitySchemaGenerator, - _resourceFieldValidationMetadataProvider, _relationshipTypeFactory, resourceTypeInfo); - - OpenApiSchema effectiveFullSchemaForResourceData = fullSchemaForResourceData.UnwrapLastExtendedSchema(); + OpenApiSchema fullSchemaForDerivedType = fullSchemaForResourceData.UnwrapLastExtendedSchema(); - if (effectiveFullSchemaForResourceData == fullSchemaForResourceData) + if (fullSchemaForDerivedType == fullSchemaForResourceData) { AdaptResourceIdentity(resourceTypeInfo, fullSchemaForResourceData); SetResourceType(fullSchemaForResourceData, resourceTypeInfo.ResourceType, schemaRepository); @@ -85,13 +83,23 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo fullSchemaForResourceData.Description = _resourceDocumentationReader.GetDocumentationForType(resourceTypeInfo.ResourceType); - SetResourceAttributes(effectiveFullSchemaForResourceData, fieldSchemaBuilder, schemaRepository); - SetResourceRelationships(effectiveFullSchemaForResourceData, fieldSchemaBuilder, schemaRepository); + var fieldSchemaBuilder = new ResourceFieldSchemaBuilder(_defaultSchemaGenerator, _resourceIdentifierSchemaGenerator, _linksVisibilitySchemaGenerator, + _resourceFieldValidationMetadataProvider, _relationshipTypeFactory, resourceTypeInfo); + + if (fullSchemaForDerivedType.Properties.ContainsKey(JsonApiPropertyName.Attributes)) + { + SetResourceAttributes(fullSchemaForDerivedType, fieldSchemaBuilder, schemaRepository); + } + + if (fullSchemaForDerivedType.Properties.ContainsKey(JsonApiPropertyName.Relationships)) + { + SetResourceRelationships(fullSchemaForDerivedType, fieldSchemaBuilder, schemaRepository); + } - _linksVisibilitySchemaGenerator.UpdateSchemaForResource(resourceTypeInfo, effectiveFullSchemaForResourceData, schemaRepository); + _linksVisibilitySchemaGenerator.UpdateSchemaForResource(resourceTypeInfo, fullSchemaForDerivedType, schemaRepository); #if NET6_0 - effectiveFullSchemaForResourceData.ReorderProperties(ResourceDataPropertyNamesInOrder); + fullSchemaForDerivedType.ReorderProperties(ResourceDataPropertyNamesInOrder); #endif return referenceSchemaForResourceData; @@ -117,7 +125,7 @@ private void AdaptResourceIdentity(ResourceTypeInfo resourceTypeInfo, OpenApiSch private void SetResourceType(OpenApiSchema fullSchemaForResourceData, ResourceType resourceType, SchemaRepository schemaRepository) { - OpenApiSchema referenceSchema = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + OpenApiSchema referenceSchema = _resourceTypeSchemaGenerator.GenerateSchema(resourceType, schemaRepository); fullSchemaForResourceData.Properties[JsonApiPropertyName.Type] = referenceSchema.WrapInExtendedSchema(); } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs similarity index 98% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs index 2820a1aaef..953df234cf 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/LinksVisibilitySchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs @@ -2,11 +2,12 @@ using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Relationships; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SwaggerComponents; using JsonApiDotNetCore.Resources.Annotations; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; /// /// Hides links that are never returned. diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/MetaSchemaGenerator.cs similarity index 94% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/MetaSchemaGenerator.cs index 0c2d19b901..544627c1a5 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/MetaSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/MetaSchemaGenerator.cs @@ -2,7 +2,7 @@ using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; internal sealed class MetaSchemaGenerator { diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs similarity index 92% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs index 5c900fc6b2..4e100d05f1 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceIdentifierSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs @@ -3,7 +3,7 @@ using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; internal sealed class ResourceIdentifierSchemaGenerator { @@ -31,7 +31,7 @@ public OpenApiSchema GenerateSchema(ResourceType resourceType, SchemaRepository referenceSchemaForIdentifier = _defaultSchemaGenerator.GenerateSchema(resourceIdentifierConstructedType, schemaRepository); OpenApiSchema fullSchemaForIdentifier = schemaRepository.Schemas[referenceSchemaForIdentifier.Reference.Id]; - OpenApiSchema referenceSchemaForResourceType = _resourceTypeSchemaGenerator.Get(resourceType, schemaRepository); + OpenApiSchema referenceSchemaForResourceType = _resourceTypeSchemaGenerator.GenerateSchema(resourceType, schemaRepository); fullSchemaForIdentifier.Properties[JsonApiPropertyName.Type] = referenceSchemaForResourceType.WrapInExtendedSchema(); } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceTypeSchemaGenerator.cs similarity index 65% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs rename to src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceTypeSchemaGenerator.cs index bf5f699725..f5399618d7 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceTypeSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceTypeSchemaGenerator.cs @@ -3,7 +3,7 @@ using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; internal sealed class ResourceTypeSchemaGenerator { @@ -16,7 +16,7 @@ public ResourceTypeSchemaGenerator(JsonApiSchemaIdSelector schemaIdSelector) _schemaIdSelector = schemaIdSelector; } - public OpenApiSchema Get(ResourceType resourceType, SchemaRepository schemaRepository) + public OpenApiSchema GenerateSchema(ResourceType resourceType, SchemaRepository schemaRepository) { ArgumentGuard.NotNull(resourceType); ArgumentGuard.NotNull(schemaRepository); @@ -29,25 +29,13 @@ public OpenApiSchema Get(ResourceType resourceType, SchemaRepository schemaRepos var fullSchema = new OpenApiSchema { Type = "string", - Enum = new List - { - new OpenApiString(resourceType.PublicName) - }, + Enum = [new OpenApiString(resourceType.PublicName)], AdditionalPropertiesAllowed = false }; string schemaId = _schemaIdSelector.GetResourceTypeSchemaId(resourceType); - referenceSchema = new OpenApiSchema - { - Reference = new OpenApiReference - { - Id = schemaId, - Type = ReferenceType.Schema - } - }; - - schemaRepository.AddDefinition(schemaId, fullSchema); + referenceSchema = schemaRepository.AddDefinition(schemaId, fullSchema); schemaRepository.RegisterType(resourceType.ClrType, schemaId); return referenceSchema; diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/JsonApiSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/JsonApiSchemaGenerator.cs new file mode 100644 index 0000000000..d15b2b1428 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/JsonApiSchemaGenerator.cs @@ -0,0 +1,67 @@ +using System.Reflection; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators; + +internal sealed class JsonApiSchemaGenerator : ISchemaGenerator +{ + private static readonly OpenApiSchema IdTypeSchema = new() + { + Type = "string" + }; + + private readonly ICollection _bodySchemaGenerators; + + public JsonApiSchemaGenerator(IEnumerable bodySchemaGenerators) + { + ArgumentGuard.NotNull(bodySchemaGenerators); + + _bodySchemaGenerators = bodySchemaGenerators.ToArray(); + } + + public OpenApiSchema GenerateSchema(Type modelType, SchemaRepository schemaRepository, MemberInfo? memberInfo = null, ParameterInfo? parameterInfo = null, + ApiParameterRouteInfo? routeInfo = null) + { + ArgumentGuard.NotNull(modelType); + ArgumentGuard.NotNull(schemaRepository); + + if (parameterInfo is { Name: "id" } && IsJsonApiParameter(parameterInfo)) + { + return IdTypeSchema; + } + + BodySchemaGenerator schemaGenerator = GetBodySchemaGenerator(modelType); + OpenApiSchema referenceSchema = schemaGenerator.GenerateSchema(modelType, schemaRepository); + + if (memberInfo != null || parameterInfo != null) + { + // For unknown reasons, Swashbuckle chooses to wrap request bodies in allOf, but not response bodies. + // We just replicate that behavior here. See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/861#issuecomment-1373631712. + referenceSchema = referenceSchema.WrapInExtendedSchema(); + } + + return referenceSchema; + } + + private static bool IsJsonApiParameter(ParameterInfo parameter) + { + return parameter.Member.DeclaringType != null && parameter.Member.DeclaringType.IsAssignableTo(typeof(CoreJsonApiController)); + } + + private BodySchemaGenerator GetBodySchemaGenerator(Type modelType) + { + foreach (BodySchemaGenerator bodySchemaGenerator in _bodySchemaGenerators) + { + if (bodySchemaGenerator.CanGenerate(modelType)) + { + return bodySchemaGenerator; + } + } + + throw new UnreachableCodeException(); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs index 54c25f649e..a8c21d992d 100644 --- a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs @@ -1,4 +1,7 @@ using JsonApiDotNetCore.OpenApi.JsonApiMetadata; +using JsonApiDotNetCore.OpenApi.SchemaGenerators; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; using JsonApiDotNetCore.OpenApi.SwaggerComponents; using JsonApiDotNetCore.Serialization.Response; using Microsoft.AspNetCore.Mvc; @@ -86,12 +89,14 @@ private static void AddSchemaGenerators(IServiceCollection services) services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddEnumerable(ServiceDescriptor.Singleton()); + services.TryAddEnumerable(ServiceDescriptor.Singleton()); + services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); } } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs deleted file mode 100644 index e761f9ff2c..0000000000 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentSchemaGenerator.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System.Reflection; -using JsonApiDotNetCore.Configuration; -using JsonApiDotNetCore.OpenApi.JsonApiObjects; -using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; -using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; -using JsonApiDotNetCore.Serialization.Objects; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; - -internal sealed class DocumentSchemaGenerator -{ - private readonly SchemaGenerator _defaultSchemaGenerator; - private readonly AbstractResourceDataSchemaGenerator _abstractResourceDataSchemaGenerator; - private readonly ResourceDataSchemaGenerator _resourceDataSchemaGenerator; - private readonly MetaSchemaGenerator _metaSchemaGenerator; - private readonly LinksVisibilitySchemaGenerator _linksVisibilitySchemaGenerator; - private readonly IncludeDependencyScanner _includeDependencyScanner; - private readonly IResourceGraph _resourceGraph; - private readonly IJsonApiOptions _options; - - public DocumentSchemaGenerator(SchemaGenerator defaultSchemaGenerator, AbstractResourceDataSchemaGenerator abstractResourceDataSchemaGenerator, - ResourceDataSchemaGenerator resourceDataSchemaGenerator, MetaSchemaGenerator metaSchemaGenerator, - LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph, - IJsonApiOptions options) - { - ArgumentGuard.NotNull(defaultSchemaGenerator); - ArgumentGuard.NotNull(abstractResourceDataSchemaGenerator); - ArgumentGuard.NotNull(resourceDataSchemaGenerator); - ArgumentGuard.NotNull(metaSchemaGenerator); - ArgumentGuard.NotNull(linksVisibilitySchemaGenerator); - ArgumentGuard.NotNull(includeDependencyScanner); - ArgumentGuard.NotNull(resourceGraph); - ArgumentGuard.NotNull(options); - - _defaultSchemaGenerator = defaultSchemaGenerator; - _abstractResourceDataSchemaGenerator = abstractResourceDataSchemaGenerator; - _resourceDataSchemaGenerator = resourceDataSchemaGenerator; - _metaSchemaGenerator = metaSchemaGenerator; - _linksVisibilitySchemaGenerator = linksVisibilitySchemaGenerator; - _includeDependencyScanner = includeDependencyScanner; - _resourceGraph = resourceGraph; - _options = options; - } - - public OpenApiSchema GenerateSchema(Type modelType, SchemaRepository schemaRepository) - { - ArgumentGuard.NotNull(modelType); - ArgumentGuard.NotNull(schemaRepository); - - _ = _metaSchemaGenerator.GenerateSchema(schemaRepository); - - if (modelType == typeof(ErrorResponseDocument)) - { - GenerateErrorObjectSchema(schemaRepository); - } - - OpenApiSchema referenceSchemaForDocument = modelType.IsConstructedGenericType - ? GenerateJsonApiDocumentSchema(modelType, schemaRepository) - : _defaultSchemaGenerator.GenerateSchema(modelType, schemaRepository); - - OpenApiSchema fullSchemaForDocument = schemaRepository.Schemas[referenceSchemaForDocument.Reference.Id]; - - SetJsonApiVersion(fullSchemaForDocument); - - _linksVisibilitySchemaGenerator.UpdateSchemaForTopLevel(modelType, fullSchemaForDocument, schemaRepository); - - return referenceSchemaForDocument; - } - - private void GenerateErrorObjectSchema(SchemaRepository schemaRepository) - { - OpenApiSchema referenceSchemaForErrorObject = _defaultSchemaGenerator.GenerateSchema(typeof(ErrorObject), schemaRepository); - OpenApiSchema fullSchemaForErrorObject = schemaRepository.Schemas[referenceSchemaForErrorObject.Reference.Id]; - - OpenApiSchema referenceSchemaForMeta = _metaSchemaGenerator.GenerateSchema(schemaRepository); - fullSchemaForErrorObject.Properties[JsonApiPropertyName.Meta] = referenceSchemaForMeta.WrapInExtendedSchema(); - } - - private OpenApiSchema GenerateJsonApiDocumentSchema(Type documentType, SchemaRepository schemaRepository) - { - // There's no way to intercept in the Swashbuckle recursive component schema generation when using inheritance, which we need - // to perform generic type expansions. As a workaround, we generate an empty base schema upfront. Each time the schema - // for a derived type is generated, we'll add it to the discriminator mapping. - _ = _abstractResourceDataSchemaGenerator.Get(schemaRepository); - - Type resourceDataConstructedType = GetInnerTypeOfDataProperty(documentType); - - // Ensure all reachable related resource types are available in the discriminator mapping so includes work. - // Doing this matters when not all endpoints are exposed. - EnsureResourceTypesAreMappedInDiscriminator(resourceDataConstructedType, schemaRepository); - - OpenApiSchema referenceSchemaForResourceData = _resourceDataSchemaGenerator.GenerateSchema(resourceDataConstructedType, schemaRepository); - _abstractResourceDataSchemaGenerator.MapDiscriminator(resourceDataConstructedType, referenceSchemaForResourceData, schemaRepository); - - OpenApiSchema referenceSchemaForDocument = _defaultSchemaGenerator.GenerateSchema(documentType, schemaRepository); - OpenApiSchema fullSchemaForDocument = schemaRepository.Schemas[referenceSchemaForDocument.Reference.Id]; - - if (JsonApiSchemaFacts.HasNullableDataProperty(documentType)) - { - SetDataSchemaToNullable(fullSchemaForDocument); - } - - return referenceSchemaForDocument; - } - - private static Type GetInnerTypeOfDataProperty(Type documentType) - { - PropertyInfo? dataProperty = documentType.GetProperty("Data"); - - if (dataProperty == null) - { - throw new UnreachableCodeException(); - } - - return dataProperty.PropertyType.ConstructedToOpenType().IsAssignableTo(typeof(ICollection<>)) - ? dataProperty.PropertyType.GenericTypeArguments[0] - : dataProperty.PropertyType; - } - - private void EnsureResourceTypesAreMappedInDiscriminator(Type resourceDataConstructedType, SchemaRepository schemaRepository) - { - Type resourceDataOpenType = resourceDataConstructedType.GetGenericTypeDefinition(); - - if (resourceDataOpenType == typeof(ResourceDataInResponse<>)) - { - Type resourceClrType = resourceDataConstructedType.GetGenericArguments()[0]; - ResourceType resourceType = _resourceGraph.GetResourceType(resourceClrType); - - foreach (ResourceType nextResourceType in _includeDependencyScanner.GetReachableRelatedTypes(resourceType)) - { - Type nextResourceDataConstructedType = typeof(ResourceDataInResponse<>).MakeGenericType(nextResourceType.ClrType); - - OpenApiSchema nextReferenceSchemaForResourceData = - _resourceDataSchemaGenerator.GenerateSchema(nextResourceDataConstructedType, schemaRepository); - - _abstractResourceDataSchemaGenerator.MapDiscriminator(nextResourceDataConstructedType, nextReferenceSchemaForResourceData, schemaRepository); - } - } - } - - private static void SetDataSchemaToNullable(OpenApiSchema fullSchemaForDocument) - { - OpenApiSchema referenceSchemaForData = fullSchemaForDocument.Properties[JsonApiPropertyName.Data]; - referenceSchemaForData.Nullable = true; - fullSchemaForDocument.Properties[JsonApiPropertyName.Data] = referenceSchemaForData; - } - - private void SetJsonApiVersion(OpenApiSchema fullSchemaForDocument) - { - if (fullSchemaForDocument.Properties.ContainsKey(JsonApiPropertyName.Jsonapi) && !_options.IncludeJsonApiVersion) - { - fullSchemaForDocument.Properties.Remove(JsonApiPropertyName.Jsonapi); - } - } -} diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiSchemaGenerator.cs deleted file mode 100644 index af4d0167ef..0000000000 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiSchemaGenerator.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Reflection; -using JsonApiDotNetCore.Controllers; -using JsonApiDotNetCore.OpenApi.JsonApiObjects; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; - -internal sealed class JsonApiSchemaGenerator : ISchemaGenerator -{ - private static readonly OpenApiSchema IdTypeSchema = new() - { - Type = "string" - }; - - private readonly ISchemaGenerator _defaultSchemaGenerator; - private readonly DocumentSchemaGenerator _documentSchemaGenerator; - - public JsonApiSchemaGenerator(SchemaGenerator defaultSchemaGenerator, DocumentSchemaGenerator documentSchemaGenerator) - { - ArgumentGuard.NotNull(defaultSchemaGenerator); - ArgumentGuard.NotNull(documentSchemaGenerator); - - _defaultSchemaGenerator = defaultSchemaGenerator; - _documentSchemaGenerator = documentSchemaGenerator; - } - - public OpenApiSchema GenerateSchema(Type modelType, SchemaRepository schemaRepository, MemberInfo? memberInfo = null, ParameterInfo? parameterInfo = null, - ApiParameterRouteInfo? routeInfo = null) - { - ArgumentGuard.NotNull(modelType); - ArgumentGuard.NotNull(schemaRepository); - - if (parameterInfo is { Name: "id" } && IsJsonApiParameter(parameterInfo)) - { - return IdTypeSchema; - } - - if (schemaRepository.TryLookupByType(modelType, out OpenApiSchema jsonApiDocumentSchema)) - { - // For unknown reasons, Swashbuckle chooses to wrap root request bodies, but not response bodies. - // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/861#issuecomment-1373631712 - return memberInfo != null || parameterInfo != null - ? _defaultSchemaGenerator.GenerateSchema(modelType, schemaRepository, memberInfo, parameterInfo) - : jsonApiDocumentSchema; - } - - if (JsonApiSchemaFacts.RequiresCustomSchemaGenerator(modelType)) - { - _ = _documentSchemaGenerator.GenerateSchema(modelType, schemaRepository); - - // Schema might depend on other schemas not handled by us, so should not return here. - } - - return _defaultSchemaGenerator.GenerateSchema(modelType, schemaRepository, memberInfo, parameterInfo, routeInfo); - } - - private static bool IsJsonApiParameter(ParameterInfo parameter) - { - return parameter.Member.DeclaringType != null && parameter.Member.DeclaringType.IsAssignableTo(typeof(CoreJsonApiController)); - } -} diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs index 012e791be1..e2e25b9bb2 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs @@ -1,7 +1,7 @@ using System.Reflection; using JsonApiDotNetCore.OpenApi.JsonApiMetadata; -using JsonApiDotNetCore.OpenApi.JsonApiObjects; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; using JsonApiDotNetCore.Resources.Annotations; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; @@ -95,7 +95,7 @@ private static AttrCapabilities GetRequiredCapabilityForAttributes(Type resource resourceDataOpenType == typeof(DataInUpdateResourceRequest<>) ? AttrCapabilities.AllowChange : throw new UnreachableCodeException(); } - private void EnsureAttributeSchemaIsExposed(OpenApiSchema attributeReferenceSchema, AttrAttribute attribute, SchemaRepository schemaRepository) + private void EnsureAttributeSchemaIsExposed(OpenApiSchema referenceSchemaForAttribute, AttrAttribute attribute, SchemaRepository schemaRepository) { Type nonNullableTypeInPropertyType = GetRepresentedTypeForAttributeSchema(attribute); @@ -104,7 +104,7 @@ private void EnsureAttributeSchemaIsExposed(OpenApiSchema attributeReferenceSche return; } - string schemaId = attributeReferenceSchema.Reference.Id; + string schemaId = referenceSchemaForAttribute.Reference.Id; OpenApiSchema fullSchema = _resourceSchemaRepository.Schemas[schemaId]; schemaRepository.AddDefinition(schemaId, fullSchema); @@ -154,7 +154,7 @@ private void AddRelationshipSchemaToResourceData(RelationshipAttribute relations Type relationshipSchemaType = GetRelationshipSchemaType(relationship, _resourceTypeInfo.ResourceDataOpenType); OpenApiSchema referenceSchemaForRelationship = GetReferenceSchemaForRelationship(relationshipSchemaType, schemaRepository) ?? - CreateRelationshipReferenceSchema(relationshipSchemaType, schemaRepository); + CreateReferenceSchemaForRelationship(relationshipSchemaType, schemaRepository); OpenApiSchema extendedReferenceSchemaForRelationship = referenceSchemaForRelationship.WrapInExtendedSchema(); extendedReferenceSchemaForRelationship.Description = _resourceDocumentationReader.GetDocumentationForRelationship(relationship); @@ -178,7 +178,7 @@ private Type GetRelationshipSchemaType(RelationshipAttribute relationship, Type return schemaRepository.TryLookupByType(relationshipSchemaType, out OpenApiSchema? referenceSchema) ? referenceSchema : null; } - private OpenApiSchema CreateRelationshipReferenceSchema(Type relationshipSchemaType, SchemaRepository schemaRepository) + private OpenApiSchema CreateReferenceSchemaForRelationship(Type relationshipSchemaType, SchemaRepository schemaRepository) { OpenApiSchema referenceSchema = _defaultSchemaGenerator.GenerateSchema(relationshipSchemaType, schemaRepository); From eab1f55439f1bc1a365b463ebaada416e4d8a0b0 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:25:51 +0200 Subject: [PATCH 6/7] Simplify clone methods by using generic type parameter --- ...onApiActionDescriptorCollectionProvider.cs | 30 ++++++------------- .../ObjectExtensions.cs | 5 ++-- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs index 8576e8fb2d..abb530cef7 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs @@ -13,8 +13,10 @@ namespace JsonApiDotNetCore.OpenApi; /// /// Adds JsonApiDotNetCore metadata to s if available. This translates to updating response types in -/// and performing an expansion for secondary and relationship endpoints (eg -/// /article/{id}/{relationshipName} -> /article/{id}/author, /article/{id}/revisions, etc). +/// and performing an expansion for secondary and relationship endpoints. For example: +/// /article/{id}/author, /article/{id}/revisions, etc. +/// ]]> /// internal sealed class JsonApiActionDescriptorCollectionProvider : IActionDescriptorCollectionProvider { @@ -163,30 +165,16 @@ private static void UpdateBodyParameterDescriptor(ActionDescriptor endpoint, Typ private static ActionDescriptor Clone(ActionDescriptor descriptor) { - var clone = (ActionDescriptor)descriptor.MemberwiseClone(); - - clone.AttributeRouteInfo = (AttributeRouteInfo)descriptor.AttributeRouteInfo!.MemberwiseClone(); - - clone.FilterDescriptors = new List(); - - foreach (FilterDescriptor filter in descriptor.FilterDescriptors) - { - clone.FilterDescriptors.Add(Clone(filter)); - } - - clone.Parameters = new List(); - - foreach (ParameterDescriptor parameter in descriptor.Parameters) - { - clone.Parameters.Add((ParameterDescriptor)parameter.MemberwiseClone()); - } - + ActionDescriptor clone = descriptor.MemberwiseClone(); + clone.AttributeRouteInfo = descriptor.AttributeRouteInfo!.MemberwiseClone(); + clone.FilterDescriptors = descriptor.FilterDescriptors.Select(Clone).ToList(); + clone.Parameters = descriptor.Parameters.Select(parameter => parameter.MemberwiseClone()).ToList(); return clone; } private static FilterDescriptor Clone(FilterDescriptor descriptor) { - var clone = (IFilterMetadata)descriptor.Filter.MemberwiseClone(); + IFilterMetadata clone = descriptor.Filter.MemberwiseClone(); return new FilterDescriptor(clone, descriptor.Scope) { diff --git a/src/JsonApiDotNetCore.OpenApi/ObjectExtensions.cs b/src/JsonApiDotNetCore.OpenApi/ObjectExtensions.cs index 8c216c93df..d2587a1b91 100644 --- a/src/JsonApiDotNetCore.OpenApi/ObjectExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/ObjectExtensions.cs @@ -8,10 +8,11 @@ internal static class ObjectExtensions new(() => typeof(object).GetMethod(nameof(MemberwiseClone), BindingFlags.Instance | BindingFlags.NonPublic)!, LazyThreadSafetyMode.ExecutionAndPublication); - public static object MemberwiseClone(this object source) + public static T MemberwiseClone(this T source) + where T : class { ArgumentGuard.NotNull(source); - return MemberwiseCloneMethod.Value.Invoke(source, null)!; + return (T)MemberwiseCloneMethod.Value.Invoke(source, null)!; } } From e9476b87c62d368019340430b39fa876c203f1e0 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:41:33 +0200 Subject: [PATCH 7/7] Add OpenAPI support for atomic operations --- CSharpGuidelinesAnalyzer.config | 2 +- docs/usage/openapi-client.md | 50 +- .../JsonApiDotNetCoreExample.json | 1595 ++- .../GeneratedCode/Api/ApiRequestBuilder.cs | 6 + .../Operations/OperationsRequestBuilder.cs | 99 + .../GeneratedCode/Models/AddOperationCode.cs | 15 + ...nAssignedTodoItemsRelationshipOperation.cs | 87 + ...rsonOwnedTodoItemsRelationshipOperation.cs | 87 + .../AddToTagTodoItemsRelationshipOperation.cs | 87 + .../AddToTodoItemTagsRelationshipOperation.cs | 87 + .../GeneratedCode/Models/AtomicOperation.cs | 97 + .../GeneratedCode/Models/AtomicResult.cs | 88 + .../Models/CreatePersonOperation.cs | 69 + .../Models/CreateTagOperation.cs | 69 + .../Models/CreateTodoItemOperation.cs | 69 + .../Models/DataInCreatePersonRequest.cs | 18 + .../Models/DataInCreateTagRequest.cs | 18 + .../Models/DataInCreateTodoItemRequest.cs | 18 + .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/DataInUpdatePersonRequest.cs | 18 + .../Models/DataInUpdateTagRequest.cs | 18 + .../Models/DataInUpdateTodoItemRequest.cs | 18 + .../Models/DeletePersonOperation.cs | 69 + .../Models/DeleteTagOperation.cs | 69 + .../Models/DeleteTodoItemOperation.cs | 69 + ...ullablePersonIdentifierResponseDocument.cs | 12 +- .../Models/NullableToOnePersonInRequest.cs | 12 +- .../Models/NullableToOnePersonInResponse.cs | 12 +- .../Models/OperationsRequestDocument.cs | 88 + .../Models/OperationsResponseDocument.cs | 106 + ...AssignedTodoItemsRelationshipIdentifier.cs | 104 + ...PersonAssignedTodoItemsRelationshipName.cs | 15 + .../Models/PersonDataInResponse.cs | 18 + .../Models/PersonIdentifierInRequest.cs | 96 + ...ifier.cs => PersonIdentifierInResponse.cs} | 12 +- .../PersonIdentifierResponseDocument.cs | 12 +- ...sonOwnedTodoItemsRelationshipIdentifier.cs | 104 + .../PersonOwnedTodoItemsRelationshipName.cs | 15 + ...nAssignedTodoItemsRelationshipOperation.cs | 87 + ...rsonOwnedTodoItemsRelationshipOperation.cs | 87 + ...veFromTagTodoItemsRelationshipOperation.cs | 87 + ...veFromTodoItemTagsRelationshipOperation.cs | 87 + .../Models/RemoveOperationCode.cs | 15 + .../GeneratedCode/Models/TagDataInResponse.cs | 18 + ...TagIdentifierCollectionResponseDocument.cs | 12 +- .../Models/TagIdentifierInRequest.cs | 96 + ...entifier.cs => TagIdentifierInResponse.cs} | 12 +- .../TagTodoItemsRelationshipIdentifier.cs | 104 + .../Models/TagTodoItemsRelationshipName.cs | 15 + .../Models/ToManyTagInRequest.cs | 12 +- .../Models/ToManyTagInResponse.cs | 12 +- .../Models/ToManyTodoItemInRequest.cs | 12 +- .../Models/ToManyTodoItemInResponse.cs | 12 +- .../Models/ToOnePersonInRequest.cs | 12 +- .../Models/ToOnePersonInResponse.cs | 12 +- .../TodoItemAssigneeRelationshipIdentifier.cs | 104 + .../TodoItemAssigneeRelationshipName.cs | 15 + .../Models/TodoItemDataInResponse.cs | 18 + ...temIdentifierCollectionResponseDocument.cs | 12 +- .../Models/TodoItemIdentifierInRequest.cs | 96 + ...ier.cs => TodoItemIdentifierInResponse.cs} | 12 +- .../TodoItemOwnerRelationshipIdentifier.cs | 104 + .../Models/TodoItemOwnerRelationshipName.cs | 15 + .../TodoItemTagsRelationshipIdentifier.cs | 104 + .../Models/TodoItemTagsRelationshipName.cs | 15 + .../Models/UpdateOperationCode.cs | 15 + ...nAssignedTodoItemsRelationshipOperation.cs | 87 + .../Models/UpdatePersonOperation.cs | 87 + ...rsonOwnedTodoItemsRelationshipOperation.cs | 87 + .../Models/UpdateTagOperation.cs | 87 + ...UpdateTagTodoItemsRelationshipOperation.cs | 87 + ...teTodoItemAssigneeRelationshipOperation.cs | 87 + .../Models/UpdateTodoItemOperation.cs | 87 + ...pdateTodoItemOwnerRelationshipOperation.cs | 87 + ...UpdateTodoItemTagsRelationshipOperation.cs | 87 + .../PeopleMessageFormatter.cs | 27 +- .../OpenApiKiotaClientExample/Worker.cs | 100 +- .../OpenApiNSwagClientExample/.editorconfig | 3 + .../OpenApiNSwagClientExample.csproj | 2 +- .../PeopleMessageFormatter.cs | 34 +- .../OpenApiNSwagClientExample/Worker.cs | 89 +- .../ConfigureSwaggerGenOptions.cs | 69 +- ...onApiActionDescriptorCollectionProvider.cs | 23 +- .../JsonApiEndpoint.cs | 3 +- .../AtomicOperationsRequestMetadata.cs | 10 + .../AtomicOperationsResponseMetadata.cs | 10 + .../JsonApiMetadata/EndpointResolver.cs | 9 +- .../JsonApiEndpointMetadataProvider.cs | 5 + .../AddToRelationshipOperation.cs | 24 + .../AtomicOperations/AtomicOperation.cs | 11 + .../AtomicOperations/AtomicResult.cs | 15 + .../CreateResourceOperation.cs | 20 + .../DeleteResourceOperation.cs | 20 + .../RemoveFromRelationshipOperation.cs | 24 + .../UpdateResourceOperation.cs | 23 + .../UpdateToManyRelationshipOperation.cs | 24 + .../UpdateToOneRelationshipOperation.cs | 25 + ...lableResourceIdentifierResponseDocument.cs | 2 +- .../Documents/OperationsRequestDocument.cs | 18 + .../Documents/OperationsResponseDocument.cs | 26 + ...rceIdentifierCollectionResponseDocument.cs | 2 +- .../ResourceIdentifierResponseDocument.cs | 2 +- .../NullableToOneRelationshipInRequest.cs | 2 +- .../NullableToOneRelationshipInResponse.cs | 2 +- .../ToManyRelationshipInRequest.cs | 2 +- .../ToManyRelationshipInResponse.cs | 2 +- .../ToOneRelationshipInRequest.cs | 2 +- .../ToOneRelationshipInResponse.cs | 2 +- .../DataInCreateResourceRequest.cs | 9 + .../DataInUpdateResourceRequest.cs | 9 + .../ResourceObjects/RelationshipIdentifier.cs | 15 + .../ResourceObjects/ResourceData.cs | 4 +- .../ResourceObjects/ResourceDataInResponse.cs | 5 + .../ResourceIdentifierInRequest.cs | 24 + ...ier.cs => ResourceIdentifierInResponse.cs} | 2 +- .../JsonApiPropertyName.cs | 4 + .../JsonApiRequestFormatMetadataProvider.cs | 7 +- .../JsonApiSchemaFacts.cs | 15 +- .../JsonApiSchemaIdSelector.cs | 123 +- .../OpenApiEndpointConvention.cs | 44 +- ...ector.cs => OpenApiOperationIdSelector.cs} | 74 +- .../AtomicOperationsBodySchemaGenerator.cs | 243 + ...sourceOrRelationshipBodySchemaGenerator.cs | 91 +- .../AbstractAtomicOperationSchemaGenerator.cs | 79 + .../AbstractResourceDataSchemaGenerator.cs | 6 - .../AtomicOperationCodeSchemaGenerator.cs | 47 + .../DataContainerSchemaGenerator.cs | 115 + .../Components/DataSchemaGenerator.cs | 71 +- .../LinksVisibilitySchemaGenerator.cs | 1 + .../RelationshipIdentifierSchemaGenerator.cs | 83 + .../RelationshipNameSchemaGenerator.cs | 47 + .../ResourceIdentifierSchemaGenerator.cs | 17 +- .../GenerationCacheSchemaGenerator.cs | 85 + .../SchemaRepositoryExtensions.cs | 50 + .../ServiceCollectionExtensions.cs | 9 +- ...=> DocumentationOpenApiOperationFilter.cs} | 31 +- .../ResourceFieldSchemaBuilder.cs | 23 +- .../UnusedComponentSchemaCleaner.cs | 13 + .../AtomicCreateResourceTests.cs | 210 + .../AtomicDeleteResourceTests.cs | 79 + .../AtomicOperations/AtomicLocalIdTests.cs | 234 + .../AtomicRelationshipTests.cs | 279 + .../AtomicUpdateResourceTests.cs | 261 + .../GeneratedCode/AtomicOperationsClient.cs | 73 + .../Courses/CoursesRequestBuilder.cs | 235 + .../Courses/Item/CoursesItemRequestBuilder.cs | 283 + .../Enrollments/EnrollmentsRequestBuilder.cs | 155 + .../Enrollments/EnrollmentsRequestBuilder.cs | 255 + .../RelationshipsRequestBuilder.cs | 44 + .../TaughtBy/TaughtByRequestBuilder.cs | 255 + .../Item/TaughtBy/TaughtByRequestBuilder.cs | 155 + .../Enrollments/EnrollmentsRequestBuilder.cs | 237 + .../Item/Course/CourseRequestBuilder.cs | 155 + .../Item/EnrollmentsItemRequestBuilder.cs | 283 + .../Course/CourseRequestBuilder.cs | 205 + .../RelationshipsRequestBuilder.cs | 44 + .../Student/StudentRequestBuilder.cs | 205 + .../Item/Student/StudentRequestBuilder.cs | 155 + .../GeneratedCode/Models/AddOperationCode.cs | 15 + ...oCourseEnrollmentsRelationshipOperation.cs | 87 + ...ddToCourseTaughtByRelationshipOperation.cs | 87 + ...StudentEnrollmentsRelationshipOperation.cs | 87 + ...ddToTeacherMentorsRelationshipOperation.cs | 87 + ...ddToTeacherTeachesRelationshipOperation.cs | 87 + .../GeneratedCode/Models/AtomicOperation.cs | 100 + .../GeneratedCode/Models/AtomicResult.cs | 88 + .../Models/AttributesInCreateCourseRequest.cs | 88 + .../AttributesInCreateEnrollmentRequest.cs | 69 + .../AttributesInCreateStudentRequest.cs | 88 + .../AttributesInCreateTeacherRequest.cs | 88 + .../Models/AttributesInUpdateCourseRequest.cs | 88 + .../AttributesInUpdateEnrollmentRequest.cs | 69 + .../AttributesInUpdateStudentRequest.cs | 88 + .../AttributesInUpdateTeacherRequest.cs | 88 + .../Models/CourseAttributesInResponse.cs | 88 + .../CourseCollectionResponseDocument.cs | 142 + .../Models/CourseDataInResponse.cs | 133 + ...CourseEnrollmentsRelationshipIdentifier.cs | 104 + .../CourseEnrollmentsRelationshipName.cs | 15 + ...rseIdentifierCollectionResponseDocument.cs | 124 + .../Models/CourseIdentifierInRequest.cs | 96 + .../Models/CourseIdentifierInResponse.cs | 78 + .../CourseIdentifierResponseDocument.cs | 124 + .../Models/CoursePrimaryResponseDocument.cs | 142 + .../Models/CourseRelationshipsInResponse.cs | 88 + .../Models/CourseResourceType.cs | 15 + .../Models/CourseSecondaryResponseDocument.cs | 142 + .../CourseTaughtByRelationshipIdentifier.cs | 104 + .../Models/CourseTaughtByRelationshipName.cs | 15 + .../Models/CreateCourseOperation.cs | 69 + .../Models/CreateCourseRequestDocument.cs | 70 + .../Models/CreateEnrollmentOperation.cs | 69 + .../Models/CreateEnrollmentRequestDocument.cs | 70 + .../Models/CreateStudentOperation.cs | 69 + .../Models/CreateStudentRequestDocument.cs | 70 + .../Models/CreateTeacherOperation.cs | 69 + .../Models/CreateTeacherRequestDocument.cs | 70 + .../Models/DataInCreateCourseRequest.cs | 114 + .../Models/DataInCreateEnrollmentRequest.cs | 114 + .../Models/DataInCreateStudentRequest.cs | 114 + .../Models/DataInCreateTeacherRequest.cs | 114 + .../GeneratedCode/Models/DataInResponse.cs | 78 + .../Models/DataInUpdateCourseRequest.cs | 132 + .../Models/DataInUpdateEnrollmentRequest.cs | 132 + .../Models/DataInUpdateStudentRequest.cs | 132 + .../Models/DataInUpdateTeacherRequest.cs | 132 + .../Models/DeleteCourseOperation.cs | 69 + .../Models/DeleteEnrollmentOperation.cs | 69 + .../Models/DeleteTeacherOperation.cs | 69 + .../Models/EnrollmentAttributesInResponse.cs | 76 + .../EnrollmentCollectionResponseDocument.cs | 142 + .../EnrollmentCourseRelationshipIdentifier.cs | 104 + .../EnrollmentCourseRelationshipName.cs | 15 + .../Models/EnrollmentDataInResponse.cs | 133 + ...entIdentifierCollectionResponseDocument.cs | 124 + .../Models/EnrollmentIdentifierInRequest.cs | 96 + .../Models/EnrollmentIdentifierInResponse.cs | 78 + .../EnrollmentPrimaryResponseDocument.cs | 142 + .../EnrollmentRelationshipsInResponse.cs | 88 + .../Models/EnrollmentResourceType.cs | 15 + ...EnrollmentStudentRelationshipIdentifier.cs | 104 + .../EnrollmentStudentRelationshipName.cs | 15 + .../GeneratedCode/Models/ErrorLinks.cs | 88 + .../GeneratedCode/Models/ErrorObject.cs | 196 + .../Models/ErrorResponseDocument.cs | 127 + .../GeneratedCode/Models/ErrorSource.cs | 106 + .../Models/ErrorTopLevelLinks.cs | 88 + .../GeneratedCode/Models/Jsonapi.cs | 124 + .../GeneratedCode/Models/Meta.cs | 60 + ...llableTeacherIdentifierResponseDocument.cs | 124 + ...ullableTeacherSecondaryResponseDocument.cs | 142 + .../Models/NullableToOneTeacherInRequest.cs | 70 + .../Models/NullableToOneTeacherInResponse.cs | 106 + .../Models/OperationsRequestDocument.cs | 88 + .../Models/OperationsResponseDocument.cs | 124 + .../GeneratedCode/Models/RelationshipLinks.cs | 88 + .../RelationshipsInCreateCourseRequest.cs | 88 + .../RelationshipsInCreateEnrollmentRequest.cs | 88 + .../RelationshipsInCreateStudentRequest.cs | 88 + .../RelationshipsInCreateTeacherRequest.cs | 88 + .../RelationshipsInUpdateCourseRequest.cs | 88 + .../RelationshipsInUpdateEnrollmentRequest.cs | 88 + .../RelationshipsInUpdateStudentRequest.cs | 88 + .../RelationshipsInUpdateTeacherRequest.cs | 88 + ...StudentEnrollmentsRelationshipOperation.cs | 87 + ...FromTeacherMentorsRelationshipOperation.cs | 87 + ...FromTeacherTeachesRelationshipOperation.cs | 87 + .../Models/RemoveOperationCode.cs | 15 + .../Models/ResourceCollectionTopLevelLinks.cs | 160 + ...sourceIdentifierCollectionTopLevelLinks.cs | 178 + .../Models/ResourceIdentifierTopLevelLinks.cs | 106 + .../GeneratedCode/Models/ResourceLinks.cs | 70 + .../Models/ResourceTopLevelLinks.cs | 88 + .../Models/StudentAttributesInResponse.cs | 88 + .../StudentCollectionResponseDocument.cs | 142 + .../Models/StudentDataInResponse.cs | 133 + ...tudentEnrollmentsRelationshipIdentifier.cs | 104 + .../StudentEnrollmentsRelationshipName.cs | 15 + ...entIdentifierCollectionResponseDocument.cs | 124 + .../Models/StudentIdentifierInRequest.cs | 96 + .../Models/StudentIdentifierInResponse.cs | 78 + .../StudentIdentifierResponseDocument.cs | 124 + .../StudentMentorRelationshipIdentifier.cs | 104 + .../Models/StudentMentorRelationshipName.cs | 15 + .../Models/StudentPrimaryResponseDocument.cs | 142 + .../Models/StudentRelationshipsInResponse.cs | 88 + .../Models/StudentResourceType.cs | 15 + .../StudentSecondaryResponseDocument.cs | 142 + .../Models/TeacherAttributesInResponse.cs | 88 + .../TeacherCollectionResponseDocument.cs | 142 + .../Models/TeacherDataInResponse.cs | 133 + ...herIdentifierCollectionResponseDocument.cs | 124 + .../Models/TeacherIdentifierInRequest.cs | 96 + .../Models/TeacherIdentifierInResponse.cs | 78 + .../TeacherMentorsRelationshipIdentifier.cs | 104 + .../Models/TeacherMentorsRelationshipName.cs | 15 + .../Models/TeacherPrimaryResponseDocument.cs | 142 + .../Models/TeacherRelationshipsInResponse.cs | 88 + .../Models/TeacherResourceType.cs | 15 + .../TeacherTeachesRelationshipIdentifier.cs | 104 + .../Models/TeacherTeachesRelationshipName.cs | 15 + .../Models/ToManyCourseInRequest.cs | 70 + .../Models/ToManyCourseInResponse.cs | 106 + .../Models/ToManyEnrollmentInRequest.cs | 70 + .../Models/ToManyEnrollmentInResponse.cs | 106 + .../Models/ToManyStudentInRequest.cs | 70 + .../Models/ToManyStudentInResponse.cs | 106 + .../Models/ToManyTeacherInRequest.cs | 70 + .../Models/ToManyTeacherInResponse.cs | 106 + .../Models/ToOneCourseInRequest.cs | 70 + .../Models/ToOneCourseInResponse.cs | 106 + .../Models/ToOneStudentInRequest.cs | 70 + .../Models/ToOneStudentInResponse.cs | 106 + ...eCourseEnrollmentsRelationshipOperation.cs | 87 + .../Models/UpdateCourseOperation.cs | 87 + .../Models/UpdateCourseRequestDocument.cs | 70 + ...teEnrollmentCourseRelationshipOperation.cs | 87 + .../Models/UpdateEnrollmentOperation.cs | 87 + .../Models/UpdateEnrollmentRequestDocument.cs | 70 + ...eEnrollmentStudentRelationshipOperation.cs | 87 + .../Models/UpdateOperationCode.cs | 15 + ...StudentEnrollmentsRelationshipOperation.cs | 87 + ...pdateStudentMentorRelationshipOperation.cs | 87 + .../Models/UpdateStudentOperation.cs | 87 + .../Models/UpdateStudentRequestDocument.cs | 70 + ...dateTeacherMentorsRelationshipOperation.cs | 87 + .../Models/UpdateTeacherOperation.cs | 87 + .../Models/UpdateTeacherRequestDocument.cs | 70 + ...dateTeacherTeachesRelationshipOperation.cs | 87 + .../Operations/OperationsRequestBuilder.cs | 99 + .../Enrollments/EnrollmentsRequestBuilder.cs | 155 + .../Item/Mentor/MentorRequestBuilder.cs | 155 + .../Enrollments/EnrollmentsRequestBuilder.cs | 305 + .../Mentor/MentorRequestBuilder.cs | 205 + .../RelationshipsRequestBuilder.cs | 44 + .../Item/StudentsItemRequestBuilder.cs | 242 + .../Students/StudentsRequestBuilder.cs | 237 + .../Item/Mentors/MentorsRequestBuilder.cs | 155 + .../Mentors/MentorsRequestBuilder.cs | 305 + .../RelationshipsRequestBuilder.cs | 44 + .../Teaches/TeachesRequestBuilder.cs | 305 + .../Item/TeachersItemRequestBuilder.cs | 283 + .../Item/Teaches/TeachesRequestBuilder.cs | 155 + .../Teachers/TeachersRequestBuilder.cs | 237 + .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/GameDataInResponse.cs | 18 + ...entifier.cs => GameIdentifierInRequest.cs} | 12 +- .../Models/GameIdentifierInResponse.cs | 78 + .../Models/PlayerDataInResponse.cs | 18 + .../Models/PlayerGroupDataInResponse.cs | 18 + ...r.cs => PlayerGroupIdentifierInRequest.cs} | 12 +- .../Models/PlayerGroupIdentifierInResponse.cs | 78 + ...tifier.cs => PlayerIdentifierInRequest.cs} | 12 +- .../Models/PlayerIdentifierInResponse.cs | 78 + .../Models/ToManyGameInRequest.cs | 12 +- .../Models/ToManyGameInResponse.cs | 12 +- .../Models/ToManyPlayerGroupInRequest.cs | 12 +- .../Models/ToManyPlayerGroupInResponse.cs | 12 +- .../Models/ToManyPlayerInRequest.cs | 12 +- .../Models/ToManyPlayerInResponse.cs | 12 +- .../Models/CountryDataInResponse.cs | 18 + .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/LanguageDataInResponse.cs | 18 + ...ageIdentifierCollectionResponseDocument.cs | 12 +- ...fier.cs => LanguageIdentifierInRequest.cs} | 12 +- .../Models/LanguageIdentifierInResponse.cs | 78 + .../Models/ToManyLanguageInRequest.cs | 12 +- .../Models/ToManyLanguageInResponse.cs | 12 +- .../Models/AccommodationDataInResponse.cs | 18 + ...cs => AccommodationIdentifierInRequest.cs} | 12 +- .../AccommodationIdentifierInResponse.cs | 78 + ...AccommodationIdentifierResponseDocument.cs | 12 +- .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/ExcursionDataInResponse.cs | 18 + ...ionIdentifierCollectionResponseDocument.cs | 12 +- ...ier.cs => ExcursionIdentifierInRequest.cs} | 12 +- .../Models/ExcursionIdentifierInResponse.cs | 78 + .../Models/NullableToOneTransportInRequest.cs | 12 +- .../NullableToOneTransportInResponse.cs | 12 +- ...ableTransportIdentifierResponseDocument.cs | 12 +- .../Models/ToManyExcursionInRequest.cs | 12 +- .../Models/ToManyExcursionInResponse.cs | 12 +- .../Models/ToOneAccommodationInRequest.cs | 12 +- .../Models/ToOneAccommodationInResponse.cs | 12 +- .../Models/TransportDataInResponse.cs | 18 + ...ier.cs => TransportIdentifierInRequest.cs} | 12 +- .../Models/TransportIdentifierInResponse.cs | 78 + .../Models/VacationDataInResponse.cs | 18 + .../GeneratedCode/Models/DataInResponse.cs | 18 - .../SocialMediaAccountDataInResponse.cs | 18 + .../OpenApiKiotaEndToEndTests.csproj | 2 + .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/NameValuePairDataInResponse.cs | 18 + ...airIdentifierCollectionResponseDocument.cs | 12 +- ...cs => NameValuePairIdentifierInRequest.cs} | 12 +- .../NameValuePairIdentifierInResponse.cs | 78 + .../Models/NodeDataInResponse.cs | 18 + ...odeIdentifierCollectionResponseDocument.cs | 12 +- ...entifier.cs => NodeIdentifierInRequest.cs} | 12 +- .../Models/NodeIdentifierInResponse.cs | 78 + .../Models/NodeIdentifierResponseDocument.cs | 12 +- .../NullableNodeIdentifierResponseDocument.cs | 12 +- .../Models/NullableToOneNodeInRequest.cs | 12 +- .../Models/NullableToOneNodeInResponse.cs | 12 +- .../Models/ToManyNameValuePairInRequest.cs | 12 +- .../Models/ToManyNameValuePairInResponse.cs | 12 +- .../Models/ToManyNodeInRequest.cs | 12 +- .../Models/ToManyNodeInResponse.cs | 12 +- .../Models/ToOneNodeInRequest.cs | 12 +- .../Models/ToOneNodeInResponse.cs | 12 +- .../QueryStrings/IncludeTests.cs | 24 +- .../CreateResourceTests.cs | 6 +- .../GeneratedCode/Models/DataInResponse.cs | 18 - .../Models/DataStreamDataInResponse.cs | 18 + ...eamIdentifierCollectionResponseDocument.cs | 12 +- ...er.cs => DataStreamIdentifierInRequest.cs} | 12 +- .../Models/DataStreamIdentifierInResponse.cs | 78 + .../DataStreamIdentifierResponseDocument.cs | 12 +- ...bleDataStreamIdentifierResponseDocument.cs | 12 +- .../NullableToOneDataStreamInRequest.cs | 12 +- .../NullableToOneDataStreamInResponse.cs | 12 +- .../Models/ReadOnlyChannelDataInResponse.cs | 18 + .../ReadOnlyResourceChannelDataInResponse.cs | 18 + .../Models/ToManyDataStreamInRequest.cs | 12 +- .../Models/ToManyDataStreamInResponse.cs | 12 +- .../Models/ToOneDataStreamInRequest.cs | 12 +- .../Models/ToOneDataStreamInResponse.cs | 12 +- .../Models/WriteOnlyChannelDataInResponse.cs | 18 + .../UpdateRelationshipTests.cs | 14 +- .../UpdateResourceTests.cs | 6 +- .../LegacyOpenApi/RequestTests.cs | 18 +- .../LegacyOpenApi/ResponseTests.cs | 16 +- .../CamelCase/GeneratedTypesTests.cs | 51 +- .../KebabCase/GeneratedTypesTests.cs | 51 +- .../PascalCase/GeneratedTypesTests.cs | 51 +- .../AtomicCreateResourceTests.cs | 201 + .../AtomicDeleteResourceTests.cs | 76 + .../AtomicOperations/AtomicLocalIdTests.cs | 212 + .../AtomicRelationshipTests.cs | 259 + .../AtomicUpdateResourceTests.cs | 250 + .../OpenApiNSwagEndToEndTests.csproj | 7 + .../QueryStrings/IncludeTests.cs | 24 +- .../CreateResourceTests.cs | 6 +- .../UpdateRelationshipTests.cs | 14 +- .../UpdateResourceTests.cs | 6 +- test/OpenApiTests/AtomicOperations/Course.cs | 25 + .../AtomicOperations/Enrollment.cs | 30 + .../GeneratedSwagger/swagger.g.json | 10180 ++++++++++++++++ .../AtomicOperations/OperationsController.cs | 13 + .../AtomicOperations/OperationsDbContext.cs | 16 + .../AtomicOperations/OperationsFakers.cs | 50 + .../AtomicOperations/OperationsTests.cs | 2177 ++++ test/OpenApiTests/AtomicOperations/Student.cs | 23 + test/OpenApiTests/AtomicOperations/Teacher.cs | 22 + .../ClientIdGenerationTests.cs | 3 + .../GeneratedSwagger/swagger.g.json | 107 +- .../Documentation/DocumentationTests.cs | 25 + .../Documentation/ErrorResponseTests.cs | 21 + .../Documentation/OperationsController.cs | 13 + .../Headers/GeneratedSwagger/swagger.g.json | 80 +- .../GeneratedSwagger/swagger.g.json | 252 +- .../LegacyOpenApi/expected-swagger.json | 252 +- .../Enabled/GeneratedSwagger/swagger.g.json | 152 +- .../GeneratedSwagger/net6.0/swagger.g.json | 12 +- .../GeneratedSwagger/net8.0/swagger.g.json | 12 +- .../CamelCase/CamelCaseTests.cs | 117 +- .../CamelCase/GeneratedSwagger/swagger.g.json | 893 +- .../KebabCase/GeneratedSwagger/swagger.g.json | 893 +- .../KebabCase/KebabCaseTests.cs | 122 +- .../NamingConventions/OperationsController.cs | 13 + .../GeneratedSwagger/swagger.g.json | 895 +- .../PascalCase/PascalCaseTests.cs | 117 +- .../GeneratedSwagger/swagger.g.json | 153 +- .../GeneratedSwagger/swagger.g.json | 86 +- .../GeneratedSwagger/swagger.g.json | 92 +- .../GeneratedSwagger/swagger.g.json | 92 +- .../GeneratedSwagger/swagger.g.json | 92 +- .../GeneratedSwagger/swagger.g.json | 106 +- .../JsonElementAssertionExtensions.cs | 5 + 459 files changed, 46466 insertions(+), 1516 deletions(-) create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddOperationCode.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonAssignedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonOwnedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTagTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTodoItemTagsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicResult.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeletePersonOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTagOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTodoItemOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsRequestDocument.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsResponseDocument.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInRequest.cs rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{PersonIdentifier.cs => PersonIdentifierInResponse.cs} (89%) create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonAssignedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonOwnedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTagTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTodoItemTagsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveOperationCode.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInRequest.cs rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TagIdentifier.cs => TagIdentifierInResponse.cs} (89%) create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInRequest.cs rename src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/{TodoItemIdentifier.cs => TodoItemIdentifierInResponse.cs} (89%) create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipIdentifier.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipName.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateOperationCode.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonAssignedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOwnedTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagTodoItemsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemAssigneeRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOwnerRelationshipOperation.cs create mode 100644 src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemTagsRelationshipOperation.cs create mode 100644 src/Examples/OpenApiNSwagClientExample/.editorconfig create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsRequestMetadata.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsResponseMetadata.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AddToRelationshipOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicResult.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/CreateResourceOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/DeleteResourceOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/RemoveFromRelationshipOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateResourceOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToManyRelationshipOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToOneRelationshipOperation.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsRequestDocument.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsResponseDocument.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipIdentifier.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInRequest.cs rename src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/{ResourceIdentifier.cs => ResourceIdentifierInResponse.cs} (84%) rename src/JsonApiDotNetCore.OpenApi/{JsonApiOperationIdSelector.cs => OpenApiOperationIdSelector.cs} (54%) create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/AtomicOperationsBodySchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractAtomicOperationSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AtomicOperationCodeSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataContainerSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipIdentifierSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipNameSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaGenerators/GenerationCacheSchemaGenerator.cs create mode 100644 src/JsonApiDotNetCore.OpenApi/SchemaRepositoryExtensions.cs rename src/JsonApiDotNetCore.OpenApi/SwaggerComponents/{JsonApiOperationDocumentationFilter.cs => DocumentationOpenApiOperationFilter.cs} (94%) create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/AtomicOperationsClient.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/CoursesRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/CoursesItemRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Enrollments/EnrollmentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/RelationshipsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/TaughtBy/TaughtByRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/TaughtBy/TaughtByRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/EnrollmentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Course/CourseRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/EnrollmentsItemRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Course/CourseRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/RelationshipsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Student/StudentRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Student/StudentRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddOperationCode.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseEnrollmentsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseTaughtByRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToStudentEnrollmentsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherMentorsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherTeachesRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicResult.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseAttributesInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseDataInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CoursePrimaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseRelationshipsInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseResourceType.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseSecondaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteCourseOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteEnrollmentOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteTeacherOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentAttributesInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentDataInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentPrimaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentRelationshipsInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentResourceType.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorObject.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorSource.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorTopLevelLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Jsonapi.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Meta.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherIdentifierResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherSecondaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateCourseRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateEnrollmentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateStudentRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateTeacherRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromStudentEnrollmentsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherMentorsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherTeachesRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveOperationCode.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceTopLevelLinks.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentAttributesInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentDataInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentPrimaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentRelationshipsInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentResourceType.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentSecondaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherAttributesInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherDataInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierCollectionResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherPrimaryResponseDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherRelationshipsInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherResourceType.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipIdentifier.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipName.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInRequest.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInResponse.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseEnrollmentsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentCourseRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentStudentRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateOperationCode.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentEnrollmentsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentMentorRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherMentorsRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherRequestDocument.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherTeachesRelationshipOperation.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Enrollments/EnrollmentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Mentor/MentorRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Mentor/MentorRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/RelationshipsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/StudentsItemRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/StudentsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Mentors/MentorsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Mentors/MentorsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/RelationshipsRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Teaches/TeachesRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/TeachersItemRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Teaches/TeachesRequestBuilder.cs create mode 100644 test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/TeachersRequestBuilder.cs rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{GameIdentifier.cs => GameIdentifierInRequest.cs} (87%) create mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerGroupIdentifier.cs => PlayerGroupIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/{PlayerIdentifier.cs => PlayerIdentifierInRequest.cs} (89%) create mode 100644 test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/{LanguageIdentifier.cs => LanguageIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{AccommodationIdentifier.cs => AccommodationIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{ExcursionIdentifier.cs => ExcursionIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/{TransportIdentifier.cs => TransportIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NameValuePairIdentifier.cs => NameValuePairIdentifierInRequest.cs} (87%) create mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/{NodeIdentifier.cs => NodeIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInResponse.cs rename test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/{DataStreamIdentifier.cs => DataStreamIdentifierInRequest.cs} (88%) create mode 100644 test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInResponse.cs create mode 100644 test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs create mode 100644 test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs create mode 100644 test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs create mode 100644 test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs create mode 100644 test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs create mode 100644 test/OpenApiTests/AtomicOperations/Course.cs create mode 100644 test/OpenApiTests/AtomicOperations/Enrollment.cs create mode 100644 test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json create mode 100644 test/OpenApiTests/AtomicOperations/OperationsController.cs create mode 100644 test/OpenApiTests/AtomicOperations/OperationsDbContext.cs create mode 100644 test/OpenApiTests/AtomicOperations/OperationsFakers.cs create mode 100644 test/OpenApiTests/AtomicOperations/OperationsTests.cs create mode 100644 test/OpenApiTests/AtomicOperations/Student.cs create mode 100644 test/OpenApiTests/AtomicOperations/Teacher.cs create mode 100644 test/OpenApiTests/Documentation/OperationsController.cs create mode 100644 test/OpenApiTests/NamingConventions/OperationsController.cs diff --git a/CSharpGuidelinesAnalyzer.config b/CSharpGuidelinesAnalyzer.config index 89b568e155..6d5453159a 100644 --- a/CSharpGuidelinesAnalyzer.config +++ b/CSharpGuidelinesAnalyzer.config @@ -1,5 +1,5 @@ - + diff --git a/docs/usage/openapi-client.md b/docs/usage/openapi-client.md index bb88381e79..f1c4091c19 100644 --- a/docs/usage/openapi-client.md +++ b/docs/usage/openapi-client.md @@ -67,7 +67,7 @@ The following steps describe how to generate and use a JSON:API client in C#, us 5. Add the following line inside the **OpenApiReference** section in your project file: ```xml - /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag + /GenerateExceptionClasses:false /GenerateNullableReferenceTypes:true /GenerateOptionalPropertiesAsNullable:true /GenerateOptionalParameters:true /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag ``` 6. Add the following glue code to connect our package with your generated code. @@ -105,19 +105,19 @@ The following steps describe how to generate and use a JSON:API client in C#, us foreach (var person in getResponse.Data) { - Console.WriteLine($"Found person {person.Id}: {person.Attributes.DisplayName}"); + Console.WriteLine($"Found person {person.Id}: {person.Attributes!.DisplayName}"); } ``` 8. Extend your demo code to send a partial PATCH request with the help of our package: ```c# - var patchRequest = new PersonPatchRequestDocument + var updatePersonRequest = new UpdatePersonRequestDocument { - Data = new PersonDataInPatchRequest + Data = new DataInUpdatePersonRequest { Id = "1", - Attributes = new PersonAttributesInPatchRequest + Attributes = new AttributesInUpdatePersonRequest { LastName = "Doe" } @@ -125,11 +125,12 @@ The following steps describe how to generate and use a JSON:API client in C#, us }; // This line results in sending "firstName: null" instead of omitting it. - using (apiClient.WithPartialAttributeSerialization(patchRequest, - person => person.FirstName)) + using (apiClient.WithPartialAttributeSerialization( + updatePersonRequest, person => person.FirstName)) { // Workaround for https://github.com/RicoSuter/NSwag/issues/2499. - await ApiResponse.TranslateAsync(() => apiClient.PatchPersonAsync(patchRequest.Data.Id, null, patchRequest)); + await ApiResponse.TranslateAsync(() => + apiClient.PatchPersonAsync(updatePersonRequest.Data.Id, updatePersonRequest)); // The sent request looks like this: // { @@ -171,6 +172,7 @@ Alternatively, the following section shows what to add to your client project fi NSwagCSharp ExampleApiClient ExampleApiClient.cs + /GenerateExceptionClasses:false /GenerateNullableReferenceTypes:true /GenerateOptionalPropertiesAsNullable:true /GenerateOptionalParameters:true /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag ``` @@ -184,7 +186,7 @@ To generate your C# client, install the Kiota tool by following the steps at htt Next, generate client code by running the [command line tool](https://learn.microsoft.com/en-us/openapi/kiota/using#client-generation). For example: ``` -dotnet kiota generate --language CSharp --class-name ExampleApiClient --output ./GeneratedCode --backing-store --exclude-backward-compatible --clean-output --clear-cache --openapi ..\JsonApiDotNetCoreExample\GeneratedSwagger\JsonApiDotNetCoreExample.json +dotnet kiota generate --language CSharp --class-name ExampleApiClient --output ./GeneratedCode --backing-store --exclude-backward-compatible --clean-output --clear-cache --openapi http://localhost:14140/swagger/v1/swagger.json ``` > [!CAUTION] @@ -216,7 +218,7 @@ For example, the following section puts the generated code in a namespace and ge ``` -Likewise, you can enable nullable reference types by adding `/GenerateNullableReferenceTypes:true`, optionally combined with `/GenerateOptionalParameters:true`. +Likewise, you can enable nullable reference types by adding `/GenerateNullableReferenceTypes:true /GenerateOptionalPropertiesAsNullable:true /GenerateOptionalParameters:true`. # [Kiota](#tab/kiota) @@ -256,9 +258,9 @@ NSwag needs extra settings to make response headers accessible. Specify the foll This enables the following code, which is explained below: ```c# -var getResponse = await ApiResponse.TranslateAsync(() => apiClient.GetPersonCollectionAsync(null, null)); +var getResponse = await ApiResponse.TranslateAsync(() => apiClient.GetPersonCollectionAsync()); string eTag = getResponse.Headers["ETag"].Single(); -Console.WriteLine($"Retrieved {getResponse.Result.Data.Count} people."); +Console.WriteLine($"Retrieved {getResponse.Result?.Data.Count ?? 0} people."); // wait some time... @@ -295,3 +297,27 @@ Due to a [bug in Kiota](https://github.com/microsoft/kiota/issues/4190), a try/c For a full example, see the [example project](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/openapi/src/Examples/OpenApiKiotaClientExample). --- + +## Atomic operations + +# [NSwag](#tab/nswag) + +[Atomic operations](~/usage/writing/bulk-batch-operations.md) are fully supported. +The [example project](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/openapi/src/Examples/OpenApiNSwagClientExample) +demonstrates how to use them. It uses local IDs to: +- Create a new tag +- Create a new person +- Create a new todo-item, tagged with the new tag, and owned by the new person +- Assign the todo-item to the created person + +# [Kiota](#tab/kiota) + +[Atomic operations](~/usage/writing/bulk-batch-operations.md) are fully supported. +See the [example project](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/openapi/src/Examples/OpenApiKiotaClientExample) +demonstrates how to use them. It uses local IDs to: +- Create a new tag +- Create a new person +- Create a new todo-item, tagged with the new tag, and owned by the new person +- Assign the todo-item to the created person + +--- diff --git a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json index e0129c0d83..39eb7497ad 100644 --- a/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json +++ b/src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json @@ -10,6 +10,95 @@ } ], "paths": { + "/api/operations": { + "post": { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "postOperations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/operationsRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/operationsResponseDocument" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, "/api/people": { "get": { "tags": [ @@ -4742,6 +4831,233 @@ }, "components": { "schemas": { + "addOperationCode": { + "enum": [ + "add" + ], + "type": "string" + }, + "addToPersonAssignedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personAssignedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToPersonOwnedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personOwnedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToTagTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/tagTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToTodoItemTagsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemTagsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tagIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "atomicOperation": { + "required": [ + "operationDiscriminator" + ], + "type": "object", + "properties": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "operationDiscriminator", + "mapping": { + "addPerson": "#/components/schemas/createPersonOperation", + "addTag": "#/components/schemas/createTagOperation", + "addToPersonAssignedTodoItems": "#/components/schemas/addToPersonAssignedTodoItemsRelationshipOperation", + "addToPersonOwnedTodoItems": "#/components/schemas/addToPersonOwnedTodoItemsRelationshipOperation", + "addToTagTodoItems": "#/components/schemas/addToTagTodoItemsRelationshipOperation", + "addToTodoItemTags": "#/components/schemas/addToTodoItemTagsRelationshipOperation", + "addTodoItem": "#/components/schemas/createTodoItemOperation", + "removeFromPersonAssignedTodoItems": "#/components/schemas/removeFromPersonAssignedTodoItemsRelationshipOperation", + "removeFromPersonOwnedTodoItems": "#/components/schemas/removeFromPersonOwnedTodoItemsRelationshipOperation", + "removeFromTagTodoItems": "#/components/schemas/removeFromTagTodoItemsRelationshipOperation", + "removeFromTodoItemTags": "#/components/schemas/removeFromTodoItemTagsRelationshipOperation", + "removePerson": "#/components/schemas/deletePersonOperation", + "removeTag": "#/components/schemas/deleteTagOperation", + "removeTodoItem": "#/components/schemas/deleteTodoItemOperation", + "updatePerson": "#/components/schemas/updatePersonOperation", + "updatePersonAssignedTodoItems": "#/components/schemas/updatePersonAssignedTodoItemsRelationshipOperation", + "updatePersonOwnedTodoItems": "#/components/schemas/updatePersonOwnedTodoItemsRelationshipOperation", + "updateTag": "#/components/schemas/updateTagOperation", + "updateTagTodoItems": "#/components/schemas/updateTagTodoItemsRelationshipOperation", + "updateTodoItem": "#/components/schemas/updateTodoItemOperation", + "updateTodoItemAssignee": "#/components/schemas/updateTodoItemAssigneeRelationshipOperation", + "updateTodoItemOwner": "#/components/schemas/updateTodoItemOwnerRelationshipOperation", + "updateTodoItemTags": "#/components/schemas/updateTodoItemTagsRelationshipOperation" + } + }, + "x-abstract": true + }, + "atomicResult": { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, "attributesInCreatePersonRequest": { "required": [ "lastName" @@ -4840,23 +5156,39 @@ }, "additionalProperties": false }, - "createPersonRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/dataInCreatePersonRequest" + "createPersonOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreatePersonRequest" + } + ] } - ] + }, + "additionalProperties": false } - }, + ], "additionalProperties": false }, - "createTagRequestDocument": { + "createPersonRequestDocument": { "required": [ "data" ], @@ -4865,22 +5197,102 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataInCreateTagRequest" + "$ref": "#/components/schemas/dataInCreatePersonRequest" } ] } }, "additionalProperties": false }, - "createTodoItemRequestDocument": { - "required": [ - "data" - ], - "type": "object", - "properties": { - "data": { - "allOf": [ - { + "createTagOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTagRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createTagRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTagRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createTodoItemOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTodoItemRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createTodoItemRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { "$ref": "#/components/schemas/dataInCreateTodoItemRequest" } ] @@ -4901,6 +5313,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4931,6 +5347,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4961,6 +5381,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4980,7 +5404,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -4988,10 +5411,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -5007,7 +5426,6 @@ }, "dataInUpdatePersonRequest": { "required": [ - "id", "type" ], "type": "object", @@ -5023,6 +5441,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5042,7 +5464,6 @@ }, "dataInUpdateTagRequest": { "required": [ - "id", "type" ], "type": "object", @@ -5058,6 +5479,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5077,7 +5502,6 @@ }, "dataInUpdateTodoItemRequest": { "required": [ - "id", "type" ], "type": "object", @@ -5093,6 +5517,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5110,6 +5538,102 @@ }, "additionalProperties": false }, + "deletePersonOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "deleteTagOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/tagIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "deleteTodoItemOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -5255,7 +5779,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInResponse" } ], "nullable": true @@ -5317,7 +5841,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInRequest" } ], "nullable": true @@ -5338,7 +5862,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInResponse" } ], "nullable": true @@ -5353,6 +5877,99 @@ }, "additionalProperties": false }, + "operationsRequestDocument": { + "required": [ + "atomic:operations" + ], + "type": "object", + "properties": { + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicOperation" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "operationsResponseDocument": { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicResult" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "personAssignedTodoItemsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/personResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/personAssignedTodoItemsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "personAssignedTodoItemsRelationshipName": { + "enum": [ + "assignedTodoItems" + ], + "type": "string", + "additionalProperties": false + }, "personAttributesInResponse": { "type": "object", "properties": { @@ -5412,8 +6029,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5448,9 +6072,8 @@ ], "additionalProperties": false }, - "personIdentifier": { + "personIdentifierInRequest": { "required": [ - "id", "type" ], "type": "object", @@ -5465,28 +6088,53 @@ "id": { "minLength": 1, "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false }, - "personIdentifierResponseDocument": { + "personIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierTopLevelLinks" + "$ref": "#/components/schemas/personResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "personIdentifierResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierTopLevelLinks" } ] }, "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInResponse" } ] }, @@ -5500,6 +6148,45 @@ }, "additionalProperties": false }, + "personOwnedTodoItemsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/personResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/personOwnedTodoItemsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "personOwnedTodoItemsRelationshipName": { + "enum": [ + "ownedTodoItems" + ], + "type": "string", + "additionalProperties": false + }, "personPrimaryResponseDocument": { "required": [ "data", @@ -5736,6 +6423,168 @@ }, "additionalProperties": false }, + "removeFromPersonAssignedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personAssignedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeFromPersonOwnedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personOwnedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeFromTagTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/tagTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeFromTodoItemTagsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemTagsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tagIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeOperationCode": { + "enum": [ + "remove" + ], + "type": "string" + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -5875,8 +6724,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5911,9 +6767,38 @@ ], "additionalProperties": false }, - "tagIdentifier": { + "tagIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tagIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "tagIdentifierInRequest": { "required": [ - "id", "type" ], "type": "object", @@ -5928,36 +6813,31 @@ "id": { "minLength": 1, "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false }, - "tagIdentifierCollectionResponseDocument": { + "tagIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/tagResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/tagIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -6019,6 +6899,45 @@ "type": "string", "additionalProperties": false }, + "tagTodoItemsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/tagResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/tagTodoItemsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "tagTodoItemsRelationshipName": { + "enum": [ + "todoItems" + ], + "type": "string", + "additionalProperties": false + }, "toManyTagInRequest": { "required": [ "data" @@ -6028,7 +6947,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/tagIdentifier" + "$ref": "#/components/schemas/tagIdentifierInRequest" } } }, @@ -6047,7 +6966,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/tagIdentifier" + "$ref": "#/components/schemas/tagIdentifierInResponse" } }, "meta": { @@ -6069,7 +6988,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/todoItemIdentifier" + "$ref": "#/components/schemas/todoItemIdentifierInRequest" } } }, @@ -6088,7 +7007,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/todoItemIdentifier" + "$ref": "#/components/schemas/todoItemIdentifierInResponse" } }, "meta": { @@ -6110,7 +7029,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInRequest" } ] } @@ -6130,7 +7049,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/personIdentifier" + "$ref": "#/components/schemas/personIdentifierInResponse" } ] }, @@ -6144,12 +7063,51 @@ }, "additionalProperties": false }, - "todoItemAttributesInResponse": { + "todoItemAssigneeRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], "type": "object", "properties": { - "description": { - "type": "string" - }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemAssigneeRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "todoItemAssigneeRelationshipName": { + "enum": [ + "assignee" + ], + "type": "string", + "additionalProperties": false + }, + "todoItemAttributesInResponse": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, "priority": { "allOf": [ { @@ -6216,8 +7174,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -6252,7 +7217,61 @@ ], "additionalProperties": false }, - "todoItemIdentifier": { + "todoItemIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "todoItemIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "todoItemIdentifierInResponse": { "required": [ "id", "type" @@ -6273,36 +7292,45 @@ }, "additionalProperties": false }, - "todoItemIdentifierCollectionResponseDocument": { + "todoItemOwnerRelationshipIdentifier": { "required": [ - "data", - "links" + "relationship", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/todoItemResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/todoItemIdentifier" - } + "id": { + "minLength": 1, + "type": "string" }, - "meta": { + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { "allOf": [ { - "$ref": "#/components/schemas/meta" + "$ref": "#/components/schemas/todoItemOwnerRelationshipName" } ] } }, "additionalProperties": false }, + "todoItemOwnerRelationshipName": { + "enum": [ + "owner" + ], + "type": "string", + "additionalProperties": false + }, "todoItemPrimaryResponseDocument": { "required": [ "data", @@ -6382,6 +7410,168 @@ "type": "string", "additionalProperties": false }, + "todoItemTagsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemTagsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "todoItemTagsRelationshipName": { + "enum": [ + "tags" + ], + "type": "string", + "additionalProperties": false + }, + "updateOperationCode": { + "enum": [ + "update" + ], + "type": "string" + }, + "updatePersonAssignedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personAssignedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updatePersonOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdatePersonRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updatePersonOwnedTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/personOwnedTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "updatePersonRequestDocument": { "required": [ "data" @@ -6398,6 +7588,45 @@ }, "additionalProperties": false }, + "updateTagOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/tagIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTagRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "updateTagRequestDocument": { "required": [ "data" @@ -6414,6 +7643,165 @@ }, "additionalProperties": false }, + "updateTagTodoItemsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/tagTodoItemsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateTodoItemAssigneeRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemAssigneeRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/personIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateTodoItemOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTodoItemRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateTodoItemOwnerRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemOwnerRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/personIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "updateTodoItemRequestDocument": { "required": [ "data" @@ -6429,6 +7817,45 @@ } }, "additionalProperties": false + }, + "updateTodoItemTagsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/todoItemTagsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tagIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs index 6b76adb2b8..63370b8caa 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/ApiRequestBuilder.cs @@ -1,5 +1,6 @@ // using Microsoft.Kiota.Abstractions; +using OpenApiKiotaClientExample.GeneratedCode.Api.Operations; using OpenApiKiotaClientExample.GeneratedCode.Api.People; using OpenApiKiotaClientExample.GeneratedCode.Api.Tags; using OpenApiKiotaClientExample.GeneratedCode.Api.TodoItems; @@ -15,6 +16,11 @@ namespace OpenApiKiotaClientExample.GeneratedCode.Api /// public class ApiRequestBuilder : BaseRequestBuilder { + /// The operations property + public OpenApiKiotaClientExample.GeneratedCode.Api.Operations.OperationsRequestBuilder Operations + { + get => new OpenApiKiotaClientExample.GeneratedCode.Api.Operations.OperationsRequestBuilder(PathParameters, RequestAdapter); + } /// The people property public OpenApiKiotaClientExample.GeneratedCode.Api.People.PeopleRequestBuilder People { diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs new file mode 100644 index 0000000000..5f5e4d43cb --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Api/Operations/OperationsRequestBuilder.cs @@ -0,0 +1,99 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaClientExample.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Api.Operations +{ + /// + /// Builds and executes requests for operations under \api\operations + /// + public class OperationsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OperationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/operations", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OperationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/operations", rawUrl) + { + } + /// + /// Performs multiple mutations in a linear and atomic manner. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaClientExample.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaClientExample.GeneratedCode.Models.OperationsResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Performs multiple mutations in a linear and atomic manner. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic-operations"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic-operations", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaClientExample.GeneratedCode.Api.Operations.OperationsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaClientExample.GeneratedCode.Api.Operations.OperationsRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddOperationCode.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddOperationCode.cs new file mode 100644 index 0000000000..995db88b6b --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum AddOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "add")] + #pragma warning disable CS1591 + Add, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonAssignedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonAssignedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..35d2d9c618 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonAssignedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToPersonAssignedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonAssignedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonAssignedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonOwnedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonOwnedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..84393cc6ec --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToPersonOwnedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToPersonOwnedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonOwnedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonOwnedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTagTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTagTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..94684a3472 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTagTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToTagTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTagTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTagTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTodoItemTagsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTodoItemTagsRelationshipOperation.cs new file mode 100644 index 0000000000..db34ddd7fd --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AddToTodoItemTagsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToTodoItemTagsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTodoItemTagsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTodoItemTagsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicOperation.cs new file mode 100644 index 0000000000..f4c5d7c3d3 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicOperation.cs @@ -0,0 +1,97 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AtomicOperation : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtomicOperation() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("operationDiscriminator")?.GetStringValue(); + return mappingValue switch + { + "addPerson" => new OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonOperation(), + "addTag" => new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagOperation(), + "addTodoItem" => new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemOperation(), + "addToPersonAssignedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonAssignedTodoItemsRelationshipOperation(), + "addToPersonOwnedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.AddToPersonOwnedTodoItemsRelationshipOperation(), + "addToTagTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTagTodoItemsRelationshipOperation(), + "addToTodoItemTags" => new OpenApiKiotaClientExample.GeneratedCode.Models.AddToTodoItemTagsRelationshipOperation(), + "removeFromPersonAssignedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonAssignedTodoItemsRelationshipOperation(), + "removeFromPersonOwnedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonOwnedTodoItemsRelationshipOperation(), + "removeFromTagTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTagTodoItemsRelationshipOperation(), + "removeFromTodoItemTags" => new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTodoItemTagsRelationshipOperation(), + "removePerson" => new OpenApiKiotaClientExample.GeneratedCode.Models.DeletePersonOperation(), + "removeTag" => new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTagOperation(), + "removeTodoItem" => new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTodoItemOperation(), + "updatePerson" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOperation(), + "updatePersonAssignedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonAssignedTodoItemsRelationshipOperation(), + "updatePersonOwnedTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOwnedTodoItemsRelationshipOperation(), + "updateTag" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagOperation(), + "updateTagTodoItems" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagTodoItemsRelationshipOperation(), + "updateTodoItem" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOperation(), + "updateTodoItemAssignee" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemAssigneeRelationshipOperation(), + "updateTodoItemOwner" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOwnerRelationshipOperation(), + "updateTodoItemTags" => new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemTagsRelationshipOperation(), + _ => new OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicResult.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicResult.cs new file mode 100644 index 0000000000..1b21d73d24 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/AtomicResult.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AtomicResult : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtomicResult() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.AtomicResult CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.AtomicResult(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonOperation.cs new file mode 100644 index 0000000000..51de658720 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreatePersonOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreatePersonOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreatePersonOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagOperation.cs new file mode 100644 index 0000000000..c6699618da --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTagOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateTagOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTagOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTagRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemOperation.cs new file mode 100644 index 0000000000..380766bfbb --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/CreateTodoItemOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateTodoItemOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.CreateTodoItemOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs index 9f522340dd..cd09d63b7e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreatePersonRequest.cs @@ -29,6 +29,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRe #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -77,6 +93,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreatePersonRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreatePersonRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -89,6 +106,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs index 9c1e3f0045..bd2a1cf02e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTagRequest.cs @@ -29,6 +29,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagReque #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -77,6 +93,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTagRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTagRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -89,6 +106,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs index b75f6cb9e9..aa2816a3a9 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInCreateTodoItemRequest.cs @@ -29,6 +29,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItem #endif /// Stores model information. public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -77,6 +93,7 @@ public virtual IDictionary> GetFieldDeserializers() return new Dictionary> { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInCreateTodoItemRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -89,6 +106,7 @@ public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs index 02587685bb..1d0cb96798 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -77,7 +61,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -88,7 +71,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs index fed9d0b96c..60183f4e99 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdatePersonRequest.cs @@ -44,6 +44,22 @@ public string Id get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -94,6 +110,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -107,6 +124,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs index d57b44ab5f..6198f9b4ee 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTagRequest.cs @@ -44,6 +44,22 @@ public string Id get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -94,6 +110,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTagRequest.CreateFromDiscriminatorValue); } }, { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTagRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -107,6 +124,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs index c23ed28b97..502a96643d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DataInUpdateTodoItemRequest.cs @@ -44,6 +44,22 @@ public string Id get { return BackingStore?.Get("id"); } set { BackingStore?.Set("id", value); } } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } #endif /// The relationships property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -94,6 +110,7 @@ public virtual IDictionary> GetFieldDeserializers() { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.AttributesInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipsInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, { "type", n => { Type = n.GetEnumValue(); } }, }; @@ -107,6 +124,7 @@ public virtual void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); writer.WriteObjectValue("attributes", Attributes); writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); writer.WriteObjectValue("relationships", Relationships); writer.WriteEnumValue("type", Type); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeletePersonOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeletePersonOperation.cs new file mode 100644 index 0000000000..33b733e0aa --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeletePersonOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeletePersonOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.DeletePersonOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DeletePersonOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTagOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTagOperation.cs new file mode 100644 index 0000000000..e932eabe57 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTagOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeleteTagOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTagOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTagOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTodoItemOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTodoItemOperation.cs new file mode 100644 index 0000000000..b7dcf81204 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/DeleteTodoItemOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeleteTodoItemOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTodoItemOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.DeleteTodoItemOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs index 4df6541a8a..218386239d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullablePersonIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class NullablePersonIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs index 64afce05b9..0e021ee102 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInRequest.cs @@ -16,16 +16,16 @@ public class NullableToOnePersonInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs index b44db2f787..d27e3f44ea 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/NullableToOnePersonInResponse.cs @@ -16,16 +16,16 @@ public class NullableToOnePersonInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsRequestDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsRequestDocument.cs new file mode 100644 index 0000000000..39edea556a --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsRequestDocument.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class OperationsRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The atomicOperations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AtomicOperations + { + get { return BackingStore?.Get?>("atomic:operations"); } + set { BackingStore?.Set("atomic:operations", value); } + } +#nullable restore +#else + public List AtomicOperations + { + get { return BackingStore?.Get>("atomic:operations"); } + set { BackingStore?.Set("atomic:operations", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OperationsRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.OperationsRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "atomic:operations", n => { AtomicOperations = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation.CreateFromDiscriminatorValue)?.ToList(); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("atomic:operations", AtomicOperations); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsResponseDocument.cs new file mode 100644 index 0000000000..9f2ae838e2 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/OperationsResponseDocument.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class OperationsResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The atomicResults property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AtomicResults + { + get { return BackingStore?.Get?>("atomic:results"); } + set { BackingStore?.Set("atomic:results", value); } + } +#nullable restore +#else + public List AtomicResults + { + get { return BackingStore?.Get>("atomic:results"); } + set { BackingStore?.Set("atomic:results", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OperationsResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.OperationsResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.OperationsResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "atomic:results", n => { AtomicResults = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.AtomicResult.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("atomic:results", AtomicResults); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipIdentifier.cs new file mode 100644 index 0000000000..7ccc5c6acc --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class PersonAssignedTodoItemsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public PersonAssignedTodoItemsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipName.cs new file mode 100644 index 0000000000..52be08a006 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonAssignedTodoItemsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum PersonAssignedTodoItemsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "assignedTodoItems")] + #pragma warning disable CS1591 + AssignedTodoItems, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs index 8c2ba270fa..0bb0779709 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInRequest.cs new file mode 100644 index 0000000000..c5341d9400 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class PersonIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public PersonIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInResponse.cs similarity index 89% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInResponse.cs index 5f537d94cf..21283aef80 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierInResponse.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class PersonIdentifier : IBackedModel, IParsable + public class PersonIdentifierInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PersonIdentifier() + public PersonIdentifierInResponse() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs index 9b340aac54..954d947315 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class PersonIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipIdentifier.cs new file mode 100644 index 0000000000..434cd57db4 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class PersonOwnedTodoItemsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public PersonOwnedTodoItemsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipName.cs new file mode 100644 index 0000000000..1d3cdd37c7 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/PersonOwnedTodoItemsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum PersonOwnedTodoItemsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "ownedTodoItems")] + #pragma warning disable CS1591 + OwnedTodoItems, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonAssignedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonAssignedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..94dccf3969 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonAssignedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromPersonAssignedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonAssignedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonAssignedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonOwnedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonOwnedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..dac90798c8 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromPersonOwnedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromPersonOwnedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonOwnedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromPersonOwnedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTagTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTagTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..7d3da501f2 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTagTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromTagTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTagTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTagTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTodoItemTagsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTodoItemTagsRelationshipOperation.cs new file mode 100644 index 0000000000..fcb2274716 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveFromTodoItemTagsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromTodoItemTagsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTodoItemTagsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.RemoveFromTodoItemTagsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveOperationCode.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveOperationCode.cs new file mode 100644 index 0000000000..c087586175 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/RemoveOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum RemoveOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "remove")] + #pragma warning disable CS1591 + Remove, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs index b1953a2f14..105b371fc4 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse At get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs index 5941bea00b..d712da6610 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class TagIdentifierCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInRequest.cs new file mode 100644 index 0000000000..1d5a5c8474 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TagIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TagIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInResponse.cs similarity index 89% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInResponse.cs index c0b41af05d..7de19e9552 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagIdentifierInResponse.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TagIdentifier : IBackedModel, IParsable + public class TagIdentifierInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TagIdentifier() + public TagIdentifierInResponse() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInResponse(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipIdentifier.cs new file mode 100644 index 0000000000..2e68a0bbbd --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TagTodoItemsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TagResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TagTodoItemsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipName.cs new file mode 100644 index 0000000000..6ea37d953b --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TagTodoItemsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TagTodoItemsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "todoItems")] + #pragma warning disable CS1591 + TodoItems, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs index a39f34b267..6bd992be2b 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInRequest.cs @@ -16,16 +16,16 @@ public class ToManyTagInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs index 2918405f45..b844199ed0 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTagInResponse.cs @@ -16,16 +16,16 @@ public class ToManyTagInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs index 9b10e7e8eb..ef7b6d48e3 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInRequest.cs @@ -16,16 +16,16 @@ public class ToManyTodoItemInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs index e369ac108a..72ee7ab54d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToManyTodoItemInResponse.cs @@ -16,16 +16,16 @@ public class ToManyTodoItemInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs index c48b551f2e..c13fb4ce57 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInRequest.cs @@ -16,16 +16,16 @@ public class ToOnePersonInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs index 9227f37c80..1a2e26575d 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/ToOnePersonInResponse.cs @@ -16,16 +16,16 @@ public class ToOnePersonInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier? Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier Data + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipIdentifier.cs new file mode 100644 index 0000000000..5db81c094c --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TodoItemAssigneeRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TodoItemAssigneeRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipName.cs new file mode 100644 index 0000000000..d491aeeeef --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemAssigneeRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TodoItemAssigneeRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "assignee")] + #pragma warning disable CS1591 + Assignee, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs index f5833e65e2..4d97420a78 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInRespon get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs index 78aa7b38c2..65c7573986 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class TodoItemIdentifierCollectionResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInRequest.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInRequest.cs new file mode 100644 index 0000000000..b51a417401 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TodoItemIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TodoItemIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInResponse.cs similarity index 89% rename from src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs rename to src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInResponse.cs index 6c21782e06..ee7fad1c4e 100644 --- a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifier.cs +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemIdentifierInResponse.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaClientExample.GeneratedCode.Models { #pragma warning disable CS1591 - public class TodoItemIdentifier : IBackedModel, IParsable + public class TodoItemIdentifierInResponse : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TodoItemIdentifier() + public TodoItemIdentifierInResponse() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifier(); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInResponse(); } /// /// The deserialization information for the current model diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipIdentifier.cs new file mode 100644 index 0000000000..58391aaca5 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TodoItemOwnerRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TodoItemOwnerRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipName.cs new file mode 100644 index 0000000000..099b201212 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemOwnerRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TodoItemOwnerRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "owner")] + #pragma warning disable CS1591 + Owner, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipIdentifier.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipIdentifier.cs new file mode 100644 index 0000000000..84950b0d64 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TodoItemTagsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TodoItemTagsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipName.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipName.cs new file mode 100644 index 0000000000..f32a4f58b0 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/TodoItemTagsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TodoItemTagsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "tags")] + #pragma warning disable CS1591 + Tags, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateOperationCode.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateOperationCode.cs new file mode 100644 index 0000000000..b608c33ad1 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum UpdateOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "update")] + #pragma warning disable CS1591 + Update, + #pragma warning restore CS1591 + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonAssignedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonAssignedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..f2f4f38dd7 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonAssignedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdatePersonAssignedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonAssignedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonAssignedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonAssignedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOperation.cs new file mode 100644 index 0000000000..34a15bc3a0 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdatePersonOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdatePersonRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOwnedTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOwnedTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..bab07cdcbe --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdatePersonOwnedTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdatePersonOwnedTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOwnedTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdatePersonOwnedTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonOwnedTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagOperation.cs new file mode 100644 index 0000000000..6a315beb27 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTagOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTagRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagTodoItemsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagTodoItemsRelationshipOperation.cs new file mode 100644 index 0000000000..30443ba89c --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTagTodoItemsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTagTodoItemsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagTodoItemsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTagTodoItemsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TagTodoItemsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemAssigneeRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemAssigneeRelationshipOperation.cs new file mode 100644 index 0000000000..47eea7a68b --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemAssigneeRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTodoItemAssigneeRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemAssigneeRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemAssigneeRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemAssigneeRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOperation.cs new file mode 100644 index 0000000000..5f5744ef77 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTodoItemOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.DataInUpdateTodoItemRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOwnerRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOwnerRelationshipOperation.cs new file mode 100644 index 0000000000..07c17c5783 --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemOwnerRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTodoItemOwnerRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOwnerRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemOwnerRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.PersonIdentifierInRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemOwnerRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemTagsRelationshipOperation.cs b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemTagsRelationshipOperation.cs new file mode 100644 index 0000000000..2af549005e --- /dev/null +++ b/src/Examples/OpenApiKiotaClientExample/GeneratedCode/Models/UpdateTodoItemTagsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaClientExample.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTodoItemTagsRelationshipOperation : OpenApiKiotaClientExample.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaClientExample.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemTagsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaClientExample.GeneratedCode.Models.UpdateTodoItemTagsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaClientExample.GeneratedCode.Models.TagIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaClientExample.GeneratedCode.Models.TodoItemTagsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/src/Examples/OpenApiKiotaClientExample/PeopleMessageFormatter.cs b/src/Examples/OpenApiKiotaClientExample/PeopleMessageFormatter.cs index be69942aec..69898f1071 100644 --- a/src/Examples/OpenApiKiotaClientExample/PeopleMessageFormatter.cs +++ b/src/Examples/OpenApiKiotaClientExample/PeopleMessageFormatter.cs @@ -20,7 +20,7 @@ private static string WritePeople(PersonCollectionResponseDocument? peopleRespon { if (peopleResponse == null) { - return "The HTTP response hasn't changed, so no response body was returned."; + return "No response body was returned."; } var builder = new StringBuilder(); @@ -28,7 +28,7 @@ private static string WritePeople(PersonCollectionResponseDocument? peopleRespon foreach (PersonDataInResponse person in peopleResponse.Data) { - WritePerson(person, peopleResponse.Included!, builder); + WritePerson(person, peopleResponse.Included ?? [], builder); } return builder.ToString(); @@ -36,30 +36,31 @@ private static string WritePeople(PersonCollectionResponseDocument? peopleRespon private static void WritePerson(PersonDataInResponse person, ICollection includes, StringBuilder builder) { - ToManyTodoItemInResponse assignedTodoItems = person.Relationships!.AssignedTodoItems!; + ICollection assignedTodoItems = person.Relationships?.AssignedTodoItems?.Data ?? []; - builder.AppendLine($" Person {person.Id}: {person.Attributes!.DisplayName} with {assignedTodoItems.Data!.Count} assigned todo-items:"); - WriteRelatedTodoItems(assignedTodoItems.Data, includes, builder); + builder.AppendLine($" Person {person.Id}: {person.Attributes?.DisplayName} with {assignedTodoItems.Count} assigned todo-items:"); + WriteRelatedTodoItems(assignedTodoItems, includes, builder); } - private static void WriteRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes, StringBuilder builder) + private static void WriteRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes, + StringBuilder builder) { - foreach (TodoItemIdentifier todoItemIdentifier in todoItemIdentifiers) + foreach (TodoItemIdentifierInResponse todoItemIdentifier in todoItemIdentifiers) { TodoItemDataInResponse includedTodoItem = includes.OfType().Single(include => include.Id == todoItemIdentifier.Id); - ToManyTagInResponse tags = includedTodoItem.Relationships!.Tags!; + ICollection tags = includedTodoItem.Relationships?.Tags?.Data ?? []; - builder.AppendLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes!.Description} with {tags.Data!.Count} tags:"); - WriteRelatedTags(tags.Data, includes, builder); + builder.AppendLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes?.Description} with {tags.Count} tags:"); + WriteRelatedTags(tags, includes, builder); } } - private static void WriteRelatedTags(IEnumerable tagIdentifiers, ICollection includes, StringBuilder builder) + private static void WriteRelatedTags(IEnumerable tagIdentifiers, ICollection includes, StringBuilder builder) { - foreach (TagIdentifier tagIdentifier in tagIdentifiers) + foreach (TagIdentifierInResponse tagIdentifier in tagIdentifiers) { TagDataInResponse includedTag = includes.OfType().Single(include => include.Id == tagIdentifier.Id); - builder.AppendLine($" Tag {includedTag.Id}: {includedTag.Attributes!.Name}"); + builder.AppendLine($" Tag {includedTag.Id}: {includedTag.Attributes?.Name}"); } } } diff --git a/src/Examples/OpenApiKiotaClientExample/Worker.cs b/src/Examples/OpenApiKiotaClientExample/Worker.cs index 656eb3498c..6a086eae00 100644 --- a/src/Examples/OpenApiKiotaClientExample/Worker.cs +++ b/src/Examples/OpenApiKiotaClientExample/Worker.cs @@ -36,6 +36,8 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) await UpdatePersonAsync(stoppingToken); + await SendOperationsRequestAsync(stoppingToken); + _ = await _apiClient.Api.People["999999"].GetAsync(cancellationToken: stoppingToken); } catch (ErrorResponseDocument exception) @@ -83,7 +85,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) private async Task UpdatePersonAsync(CancellationToken cancellationToken) { - var patchRequest = new UpdatePersonRequestDocument + var updatePersonRequest = new UpdatePersonRequestDocument { Data = new DataInUpdatePersonRequest { @@ -91,11 +93,105 @@ private async Task UpdatePersonAsync(CancellationToken cancellationToken) Id = "1", Attributes = new AttributesInUpdatePersonRequest { + // The --backing-store switch enables to send null and default values. + FirstName = null, LastName = "Doe" } } }; - _ = await _apiClient.Api.People[patchRequest.Data.Id].PatchAsync(patchRequest, cancellationToken: cancellationToken); + _ = await _apiClient.Api.People[updatePersonRequest.Data.Id].PatchAsync(updatePersonRequest, cancellationToken: cancellationToken); + } + + private async Task SendOperationsRequestAsync(CancellationToken cancellationToken) + { + var operationsRequest = new OperationsRequestDocument + { + AtomicOperations = + [ + new CreateTagOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateTagRequest + { + Type = TagResourceType.Tags, + Lid = "new-tag", + Attributes = new AttributesInCreateTagRequest + { + Name = "Housekeeping" + } + } + }, + new CreatePersonOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreatePersonRequest + { + Type = PersonResourceType.People, + Lid = "new-person", + Attributes = new AttributesInCreatePersonRequest + { + LastName = "Cinderella" + } + } + }, + new CreateTodoItemOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateTodoItemRequest + { + Type = TodoItemResourceType.TodoItems, + Lid = "new-todo-item", + Attributes = new AttributesInCreateTodoItemRequest + { + Description = "Put out the garbage", + Priority = TodoItemPriority.Medium + }, + Relationships = new RelationshipsInCreateTodoItemRequest + { + Owner = new ToOnePersonInRequest + { + Data = new PersonIdentifierInRequest + { + Type = PersonResourceType.People, + Lid = "new-person" + } + }, + Tags = new ToManyTagInRequest + { + Data = + [ + new TagIdentifierInRequest + { + Type = TagResourceType.Tags, + Lid = "new-tag" + } + ] + } + } + } + }, + new UpdateTodoItemAssigneeRelationshipOperation + { + Op = UpdateOperationCode.Update, + Ref = new TodoItemAssigneeRelationshipIdentifier + { + Type = TodoItemResourceType.TodoItems, + Lid = "new-todo-item", + Relationship = TodoItemAssigneeRelationshipName.Assignee + }, + Data = new PersonIdentifierInRequest + { + Type = PersonResourceType.People, + Lid = "new-person" + } + } + ] + }; + + OperationsResponseDocument? operationsResponse = await _apiClient.Api.Operations.PostAsync(operationsRequest, cancellationToken: cancellationToken); + + var newTodoItem = (TodoItemDataInResponse)operationsResponse!.AtomicResults!.ElementAt(2).Data!; + Console.WriteLine($"Created todo-item with ID {newTodoItem.Id}: {newTodoItem.Attributes!.Description}."); } } diff --git a/src/Examples/OpenApiNSwagClientExample/.editorconfig b/src/Examples/OpenApiNSwagClientExample/.editorconfig new file mode 100644 index 0000000000..e2ec1cac44 --- /dev/null +++ b/src/Examples/OpenApiNSwagClientExample/.editorconfig @@ -0,0 +1,3 @@ +# Workaround for incorrect nullability in NSwag generated clients. +[*Client.cs] +dotnet_diagnostic.CS8765.severity = none diff --git a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj index 72cbdf00e9..942fc78c36 100644 --- a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj +++ b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj @@ -24,7 +24,7 @@ ExampleApiClient ExampleApiClient.cs NSwagCSharp - /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag + /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /GenerateNullableReferenceTypes:true /GenerateOptionalPropertiesAsNullable:true /GenerateOptionalParameters:true /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag diff --git a/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs b/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs index 4fd5bdc6b6..81f0de9a9a 100644 --- a/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs +++ b/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs @@ -1,4 +1,3 @@ -using System.Net; using System.Text; using JetBrains.Annotations; using JsonApiDotNetCore.OpenApi.Client.NSwag; @@ -19,17 +18,17 @@ public static void PrintPeople(ApiResponse pe private static string WritePeople(ApiResponse peopleResponse) { - if (peopleResponse is { StatusCode: (int)HttpStatusCode.NotModified, Result: null }) + if (peopleResponse.Result == null) { - return "The HTTP response hasn't changed, so no response body was returned."; + return $"Status code {peopleResponse.StatusCode} was returned without a response body."; } var builder = new StringBuilder(); - builder.AppendLine($"Found {peopleResponse.Result!.Data.Count} people:"); + builder.AppendLine($"Found {peopleResponse.Result.Data.Count} people:"); - foreach (PersonDataInResponse person in peopleResponse.Result!.Data) + foreach (PersonDataInResponse person in peopleResponse.Result.Data) { - WritePerson(person, peopleResponse.Result!.Included, builder); + WritePerson(person, peopleResponse.Result.Included ?? [], builder); } return builder.ToString(); @@ -37,30 +36,31 @@ private static string WritePeople(ApiResponse private static void WritePerson(PersonDataInResponse person, ICollection includes, StringBuilder builder) { - ToManyTodoItemInResponse assignedTodoItems = person.Relationships.AssignedTodoItems; + ICollection assignedTodoItems = person.Relationships?.AssignedTodoItems?.Data ?? []; - builder.AppendLine($" Person {person.Id}: {person.Attributes.DisplayName} with {assignedTodoItems.Data.Count} assigned todo-items:"); - WriteRelatedTodoItems(assignedTodoItems.Data, includes, builder); + builder.AppendLine($" Person {person.Id}: {person.Attributes?.DisplayName} with {assignedTodoItems.Count} assigned todo-items:"); + WriteRelatedTodoItems(assignedTodoItems, includes, builder); } - private static void WriteRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes, StringBuilder builder) + private static void WriteRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes, + StringBuilder builder) { - foreach (TodoItemIdentifier todoItemIdentifier in todoItemIdentifiers) + foreach (TodoItemIdentifierInResponse todoItemIdentifier in todoItemIdentifiers) { TodoItemDataInResponse includedTodoItem = includes.OfType().Single(include => include.Id == todoItemIdentifier.Id); - ToManyTagInResponse tags = includedTodoItem.Relationships.Tags; + ICollection tags = includedTodoItem.Relationships?.Tags?.Data ?? []; - builder.AppendLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes.Description} with {tags.Data.Count} tags:"); - WriteRelatedTags(tags.Data, includes, builder); + builder.AppendLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes?.Description} with {tags.Count} tags:"); + WriteRelatedTags(tags, includes, builder); } } - private static void WriteRelatedTags(IEnumerable tagIdentifiers, ICollection includes, StringBuilder builder) + private static void WriteRelatedTags(IEnumerable tagIdentifiers, ICollection includes, StringBuilder builder) { - foreach (TagIdentifier tagIdentifier in tagIdentifiers) + foreach (TagIdentifierInResponse tagIdentifier in tagIdentifiers) { TagDataInResponse includedTag = includes.OfType().Single(include => include.Id == tagIdentifier.Id); - builder.AppendLine($" Tag {includedTag.Id}: {includedTag.Attributes.Name}"); + builder.AppendLine($" Tag {includedTag.Id}: {includedTag.Attributes?.Name}"); } } } diff --git a/src/Examples/OpenApiNSwagClientExample/Worker.cs b/src/Examples/OpenApiNSwagClientExample/Worker.cs index 413bd8b299..414cc34d09 100644 --- a/src/Examples/OpenApiNSwagClientExample/Worker.cs +++ b/src/Examples/OpenApiNSwagClientExample/Worker.cs @@ -28,6 +28,8 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) await UpdatePersonAsync(stoppingToken); + await SendOperationsRequestAsync(stoppingToken); + _ = await _apiClient.GetPersonAsync("999999", null, null, stoppingToken); } catch (ApiException exception) @@ -50,7 +52,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) private async Task UpdatePersonAsync(CancellationToken cancellationToken) { - var patchRequest = new UpdatePersonRequestDocument + var updatePersonRequest = new UpdatePersonRequestDocument { Data = new DataInUpdatePersonRequest { @@ -63,10 +65,91 @@ private async Task UpdatePersonAsync(CancellationToken cancellationToken) }; // This line results in sending "firstName: null" instead of omitting it. - using (_apiClient.WithPartialAttributeSerialization(patchRequest, + using (_apiClient.WithPartialAttributeSerialization(updatePersonRequest, person => person.FirstName)) { - _ = await ApiResponse.TranslateAsync(async () => await _apiClient.PatchPersonAsync(patchRequest.Data.Id, null, patchRequest, cancellationToken)); + _ = await ApiResponse.TranslateAsync(async () => + await _apiClient.PatchPersonAsync(updatePersonRequest.Data.Id, updatePersonRequest, cancellationToken: cancellationToken)); } } + + private async Task SendOperationsRequestAsync(CancellationToken cancellationToken) + { + var operationsRequest = new OperationsRequestDocument + { + Atomic_operations = + [ + new CreateTagOperation + { + Data = new DataInCreateTagRequest + { + Lid = "new-tag", + Attributes = new AttributesInCreateTagRequest + { + Name = "Housekeeping" + } + } + }, + new CreatePersonOperation + { + Data = new DataInCreatePersonRequest + { + Lid = "new-person", + Attributes = new AttributesInCreatePersonRequest + { + LastName = "Cinderella" + } + } + }, + new CreateTodoItemOperation + { + Data = new DataInCreateTodoItemRequest + { + Lid = "new-todo-item", + Attributes = new AttributesInCreateTodoItemRequest + { + Description = "Put out the garbage", + Priority = TodoItemPriority.Medium + }, + Relationships = new RelationshipsInCreateTodoItemRequest + { + Owner = new ToOnePersonInRequest + { + Data = new PersonIdentifierInRequest + { + Lid = "new-person" + } + }, + Tags = new ToManyTagInRequest + { + Data = + [ + new TagIdentifierInRequest + { + Lid = "new-tag" + } + ] + } + } + } + }, + new UpdateTodoItemAssigneeRelationshipOperation + { + Ref = new TodoItemAssigneeRelationshipIdentifier + { + Lid = "new-todo-item" + }, + Data = new PersonIdentifierInRequest + { + Lid = "new-person" + } + } + ] + }; + + ApiResponse operationsResponse = await _apiClient.PostOperationsAsync(operationsRequest, cancellationToken); + + var newTodoItem = (TodoItemDataInResponse)operationsResponse.Result.Atomic_results.ElementAt(2).Data!; + Console.WriteLine($"Created todo-item with ID {newTodoItem.Id}: {newTodoItem.Attributes!.Description}."); + } } diff --git a/src/JsonApiDotNetCore.OpenApi/ConfigureSwaggerGenOptions.cs b/src/JsonApiDotNetCore.OpenApi/ConfigureSwaggerGenOptions.cs index 2ba47ef0d4..af3f51156c 100644 --- a/src/JsonApiDotNetCore.OpenApi/ConfigureSwaggerGenOptions.cs +++ b/src/JsonApiDotNetCore.OpenApi/ConfigureSwaggerGenOptions.cs @@ -1,6 +1,7 @@ using System.Reflection; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Middleware; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; using JsonApiDotNetCore.OpenApi.SwaggerComponents; using Microsoft.AspNetCore.Mvc.ApiExplorer; @@ -12,21 +13,32 @@ namespace JsonApiDotNetCore.OpenApi; internal sealed class ConfigureSwaggerGenOptions : IConfigureOptions { + private static readonly Type[] AtomicOperationDerivedSchemaTypes = + [ + typeof(CreateResourceOperation<>), + typeof(UpdateResourceOperation<>), + typeof(DeleteResourceOperation<>), + typeof(UpdateToOneRelationshipOperation<>), + typeof(UpdateToManyRelationshipOperation<>), + typeof(AddToRelationshipOperation<>), + typeof(RemoveFromRelationshipOperation<>) + ]; + private readonly IControllerResourceMapping _controllerResourceMapping; - private readonly JsonApiOperationIdSelector _operationIdSelector; + private readonly OpenApiOperationIdSelector _openApiOperationIdSelector; private readonly JsonApiSchemaIdSelector _schemaIdSelector; private readonly IResourceGraph _resourceGraph; - public ConfigureSwaggerGenOptions(IControllerResourceMapping controllerResourceMapping, JsonApiOperationIdSelector operationIdSelector, + public ConfigureSwaggerGenOptions(IControllerResourceMapping controllerResourceMapping, OpenApiOperationIdSelector openApiOperationIdSelector, JsonApiSchemaIdSelector schemaIdSelector, IResourceGraph resourceGraph) { ArgumentGuard.NotNull(controllerResourceMapping); - ArgumentGuard.NotNull(operationIdSelector); + ArgumentGuard.NotNull(openApiOperationIdSelector); ArgumentGuard.NotNull(schemaIdSelector); ArgumentGuard.NotNull(resourceGraph); _controllerResourceMapping = controllerResourceMapping; - _operationIdSelector = operationIdSelector; + _openApiOperationIdSelector = openApiOperationIdSelector; _schemaIdSelector = schemaIdSelector; _resourceGraph = resourceGraph; } @@ -39,24 +51,35 @@ public void Configure(SwaggerGenOptions options) options.UseAllOfForInheritance(); options.SelectDiscriminatorNameUsing(_ => "type"); options.SelectDiscriminatorValueUsing(clrType => _resourceGraph.GetResourceType(clrType).PublicName); - options.SelectSubTypesUsing(GetConstructedTypesForResourceData); + options.SelectSubTypesUsing(SelectDerivedTypes); - SetOperationInfo(options, _controllerResourceMapping); - SetSchemaIdSelector(options); + options.TagActionsBy(description => GetOpenApiOperationTags(description, _controllerResourceMapping)); + options.CustomOperationIds(_openApiOperationIdSelector.GetOpenApiOperationId); + options.CustomSchemaIds(_schemaIdSelector.GetSchemaId); options.DocumentFilter(); options.DocumentFilter(); - options.OperationFilter(); + options.OperationFilter(); options.DocumentFilter(); } - private IEnumerable GetConstructedTypesForResourceData(Type baseType) + private IEnumerable SelectDerivedTypes(Type baseType) { - if (baseType != typeof(ResourceData)) + if (baseType == typeof(ResourceData)) { - return []; + return GetConstructedTypesForResourceData(); } + if (baseType == typeof(AtomicOperation)) + { + return GetConstructedTypesForAtomicOperation(); + } + + return []; + } + + private List GetConstructedTypesForResourceData() + { List derivedTypes = []; foreach (ResourceType resourceType in _resourceGraph.GetResourceTypes()) @@ -68,27 +91,23 @@ private IEnumerable GetConstructedTypesForResourceData(Type baseType) return derivedTypes; } - private void SetOperationInfo(SwaggerGenOptions swaggerGenOptions, IControllerResourceMapping controllerResourceMapping) - { - swaggerGenOptions.TagActionsBy(description => GetOperationTags(description, controllerResourceMapping)); - swaggerGenOptions.CustomOperationIds(_operationIdSelector.GetOperationId); - } - - private static IList GetOperationTags(ApiDescription description, IControllerResourceMapping controllerResourceMapping) + private List GetConstructedTypesForAtomicOperation() { - MethodInfo actionMethod = description.ActionDescriptor.GetActionMethod(); - ResourceType? resourceType = controllerResourceMapping.GetResourceTypeForController(actionMethod.ReflectedType); + List derivedTypes = []; - if (resourceType == null) + foreach (ResourceType resourceType in _resourceGraph.GetResourceTypes()) { - throw new NotSupportedException("Only JsonApiDotNetCore endpoints are supported."); + derivedTypes.AddRange(AtomicOperationDerivedSchemaTypes.Select(openType => openType.MakeGenericType(resourceType.ClrType))); } - return [resourceType.PublicName]; + return derivedTypes; } - private void SetSchemaIdSelector(SwaggerGenOptions swaggerGenOptions) + private static IList GetOpenApiOperationTags(ApiDescription description, IControllerResourceMapping controllerResourceMapping) { - swaggerGenOptions.CustomSchemaIds(_schemaIdSelector.GetSchemaId); + MethodInfo actionMethod = description.ActionDescriptor.GetActionMethod(); + ResourceType? resourceType = controllerResourceMapping.GetResourceTypeForController(actionMethod.ReflectedType); + + return resourceType == null ? ["operations"] : [resourceType.PublicName]; } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs index abb530cef7..8974cc8bf2 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiActionDescriptorCollectionProvider.cs @@ -2,6 +2,7 @@ using JsonApiDotNetCore.Errors; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.OpenApi.JsonApiMetadata; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Controllers; @@ -62,7 +63,7 @@ .. AddJsonApiMetadataToAction(endpoint, endpointMetadataContainer.ResponseMetada return new ActionDescriptorCollection(newDescriptors.AsReadOnly(), descriptorVersion); } - private static bool IsVisibleJsonApiEndpoint(ActionDescriptor descriptor) + internal static bool IsVisibleJsonApiEndpoint(ActionDescriptor descriptor) { // Only if in a convention ApiExplorer.IsVisible was set to false, the ApiDescriptionActionData will not be present. return descriptor is ControllerActionDescriptor controllerAction && controllerAction.Properties.ContainsKey(typeof(ApiDescriptionActionData)); @@ -75,12 +76,12 @@ private static IEnumerable AddJsonApiMetadataToAction(ActionDe case PrimaryResponseMetadata primaryMetadata: { UpdateProducesResponseTypeAttribute(endpoint, primaryMetadata.DocumentType); - return Array.Empty(); + return []; } case PrimaryRequestMetadata primaryMetadata: { UpdateBodyParameterDescriptor(endpoint, primaryMetadata.DocumentType, null); - return Array.Empty(); + return []; } case NonPrimaryEndpointMetadata nonPrimaryEndpointMetadata and (RelationshipResponseMetadata or SecondaryResponseMetadata): { @@ -91,9 +92,19 @@ private static IEnumerable AddJsonApiMetadataToAction(ActionDe { return Expand(endpoint, nonPrimaryEndpointMetadata, UpdateBodyParameterDescriptor); } + case AtomicOperationsRequestMetadata: + { + UpdateBodyParameterDescriptor(endpoint, typeof(OperationsRequestDocument), null); + return []; + } + case AtomicOperationsResponseMetadata: + { + UpdateProducesResponseTypeAttribute(endpoint, typeof(OperationsResponseDocument)); + return []; + } default: { - return Array.Empty(); + return []; } } } @@ -118,7 +129,8 @@ private static bool ProducesJsonApiResponseDocument(ActionDescriptor endpoint) { var produces = endpoint.GetFilterMetadata(); - return produces != null && produces.ContentTypes.Any(contentType => contentType == HeaderConstants.MediaType); + return produces != null && produces.ContentTypes.Any(contentType => + contentType is HeaderConstants.MediaType or HeaderConstants.AtomicOperationsMediaType or HeaderConstants.RelaxedAtomicOperationsMediaType); } private static IEnumerable Expand(ActionDescriptor genericEndpoint, NonPrimaryEndpointMetadata metadata, @@ -185,7 +197,6 @@ private static FilterDescriptor Clone(FilterDescriptor descriptor) private static void RemovePathParameter(ICollection parameters, string parameterName) { ParameterDescriptor relationshipName = parameters.Single(parameterDescriptor => parameterDescriptor.Name == parameterName); - parameters.Remove(relationshipName); } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs index a1135e492c..36bba414ed 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiEndpoint.cs @@ -11,5 +11,6 @@ internal enum JsonApiEndpoint PatchResource, PatchRelationship, DeleteResource, - DeleteRelationship + DeleteRelationship, + PostOperations } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsRequestMetadata.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsRequestMetadata.cs new file mode 100644 index 0000000000..6cadf59f21 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsRequestMetadata.cs @@ -0,0 +1,10 @@ +namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata; + +internal sealed class AtomicOperationsRequestMetadata : IJsonApiRequestMetadata +{ + public static AtomicOperationsRequestMetadata Instance { get; } = new(); + + private AtomicOperationsRequestMetadata() + { + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsResponseMetadata.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsResponseMetadata.cs new file mode 100644 index 0000000000..b79f1f90fa --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/AtomicOperationsResponseMetadata.cs @@ -0,0 +1,10 @@ +namespace JsonApiDotNetCore.OpenApi.JsonApiMetadata; + +internal sealed class AtomicOperationsResponseMetadata : IJsonApiResponseMetadata +{ + public static AtomicOperationsResponseMetadata Instance { get; } = new(); + + private AtomicOperationsResponseMetadata() + { + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs index 132965123e..10d95cd93c 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/EndpointResolver.cs @@ -11,11 +11,16 @@ internal sealed class EndpointResolver { ArgumentGuard.NotNull(controllerAction); - if (!IsJsonApiController(controllerAction) || IsOperationsController(controllerAction)) + if (!IsJsonApiController(controllerAction)) { return null; } + if (IsAtomicOperationsController(controllerAction)) + { + return JsonApiEndpoint.PostOperations; + } + HttpMethodAttribute? method = Attribute.GetCustomAttributes(controllerAction, true).OfType().FirstOrDefault(); return ResolveJsonApiEndpoint(method); @@ -26,7 +31,7 @@ private static bool IsJsonApiController(MethodInfo controllerAction) return typeof(CoreJsonApiController).IsAssignableFrom(controllerAction.ReflectedType); } - private static bool IsOperationsController(MethodInfo controllerAction) + private static bool IsAtomicOperationsController(MethodInfo controllerAction) { return typeof(BaseJsonApiOperationsController).IsAssignableFrom(controllerAction.ReflectedType); } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs index 034bfb322f..6b2138b889 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiMetadata/JsonApiEndpointMetadataProvider.cs @@ -39,6 +39,11 @@ public JsonApiEndpointMetadataContainer Get(MethodInfo controllerAction) throw new NotSupportedException($"Unable to provide metadata for non-JSON:API endpoint '{controllerAction.ReflectedType!.FullName}'."); } + if (endpoint == JsonApiEndpoint.PostOperations) + { + return new JsonApiEndpointMetadataContainer(AtomicOperationsRequestMetadata.Instance, AtomicOperationsResponseMetadata.Instance); + } + ResourceType? primaryResourceType = _controllerResourceMapping.GetResourceTypeForController(controllerAction.ReflectedType); if (primaryResourceType == null) diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AddToRelationshipOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AddToRelationshipOperation.cs new file mode 100644 index 0000000000..31524c4b54 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AddToRelationshipOperation.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class AddToRelationshipOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("ref")] + public object Ref { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + public ICollection> Data { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicOperation.cs new file mode 100644 index 0000000000..70d7b12f18 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicOperation.cs @@ -0,0 +1,11 @@ +using System.Text.Json.Serialization; +using JetBrains.Annotations; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal abstract class AtomicOperation +{ + [JsonPropertyName("meta")] + public Meta Meta { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicResult.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicResult.cs new file mode 100644 index 0000000000..8fddbcf071 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/AtomicResult.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class AtomicResult +{ + [JsonPropertyName("data")] + public ResourceData Data { get; set; } = null!; + + [JsonPropertyName("meta")] + public Meta Meta { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/CreateResourceOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/CreateResourceOperation.cs new file mode 100644 index 0000000000..9eb19f86cb --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/CreateResourceOperation.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class CreateResourceOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + public DataInCreateResourceRequest Data { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/DeleteResourceOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/DeleteResourceOperation.cs new file mode 100644 index 0000000000..43d081452a --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/DeleteResourceOperation.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class DeleteResourceOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("ref")] + public ResourceIdentifierInRequest Ref { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/RemoveFromRelationshipOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/RemoveFromRelationshipOperation.cs new file mode 100644 index 0000000000..ca918fe435 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/RemoveFromRelationshipOperation.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class RemoveFromRelationshipOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("ref")] + public object Ref { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + public ICollection> Data { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateResourceOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateResourceOperation.cs new file mode 100644 index 0000000000..f59a401d3b --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateResourceOperation.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class UpdateResourceOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [JsonPropertyName("ref")] + public ResourceIdentifierInRequest Ref { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + public DataInUpdateResourceRequest Data { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToManyRelationshipOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToManyRelationshipOperation.cs new file mode 100644 index 0000000000..06d5dfa20f --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToManyRelationshipOperation.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class UpdateToManyRelationshipOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("ref")] + public object Ref { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + public ICollection> Data { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToOneRelationshipOperation.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToOneRelationshipOperation.cs new file mode 100644 index 0000000000..86b9bcbd1a --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/AtomicOperations/UpdateToOneRelationshipOperation.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class UpdateToOneRelationshipOperation : AtomicOperation + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("op")] + public string Op { get; set; } = null!; + + [Required] + [JsonPropertyName("ref")] + public object Ref { get; set; } = null!; + + [Required] + [JsonPropertyName("data")] + // Nullability of this property is determined based on the nullability of the to-one relationship. + public ResourceIdentifierInRequest? Data { get; set; } +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs index 83db84c5d8..2d1b3581b5 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/NullableResourceIdentifierResponseDocument.cs @@ -22,7 +22,7 @@ internal sealed class NullableResourceIdentifierResponseDocument [Required] [JsonPropertyName("data")] - public ResourceIdentifier? Data { get; set; } + public ResourceIdentifierInResponse? Data { get; set; } [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsRequestDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsRequestDocument.cs new file mode 100644 index 0000000000..9bb48f41be --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsRequestDocument.cs @@ -0,0 +1,18 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class OperationsRequestDocument +{ + [Required] + [MinLength(1)] + [JsonPropertyName("atomic:operations")] + public ICollection Operations { get; set; } = null!; + + [JsonPropertyName("meta")] + public Meta Meta { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsResponseDocument.cs new file mode 100644 index 0000000000..3cf3ab95e2 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/OperationsResponseDocument.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Links; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class OperationsResponseDocument +{ + [JsonPropertyName("jsonapi")] + public Jsonapi Jsonapi { get; set; } = null!; + + [Required] + [JsonPropertyName("links")] + public ResourceTopLevelLinks Links { get; set; } = null!; + + [Required] + [MinLength(1)] + [JsonPropertyName("atomic:results")] + public IList Results { get; set; } = null!; + + [JsonPropertyName("meta")] + public Meta Meta { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs index 974fd45aef..3fe77115de 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierCollectionResponseDocument.cs @@ -20,7 +20,7 @@ internal sealed class ResourceIdentifierCollectionResponseDocument [Required] [JsonPropertyName("data")] - public ICollection> Data { get; set; } = null!; + public ICollection> Data { get; set; } = null!; [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs index 413cdcb98f..ee38e0742c 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Documents/ResourceIdentifierResponseDocument.cs @@ -20,7 +20,7 @@ internal sealed class ResourceIdentifierResponseDocument [Required] [JsonPropertyName("data")] - public ResourceIdentifier Data { get; set; } = null!; + public ResourceIdentifierInResponse Data { get; set; } = null!; [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInRequest.cs index 247f7ad14e..c9162c429b 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInRequest.cs @@ -12,5 +12,5 @@ internal sealed class NullableToOneRelationshipInRequest { [Required] [JsonPropertyName("data")] - public ResourceIdentifier? Data { get; set; } + public ResourceIdentifierInRequest? Data { get; set; } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs index a967efb35b..43c1b2f3e7 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/NullableToOneRelationshipInResponse.cs @@ -17,7 +17,7 @@ internal sealed class NullableToOneRelationshipInResponse [Required] [JsonPropertyName("data")] - public ResourceIdentifier? Data { get; set; } + public ResourceIdentifierInResponse? Data { get; set; } [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInRequest.cs index e8a4698186..f73119c742 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInRequest.cs @@ -12,5 +12,5 @@ internal sealed class ToManyRelationshipInRequest { [Required] [JsonPropertyName("data")] - public ICollection> Data { get; set; } = null!; + public ICollection> Data { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs index 24600d9027..8c89dde95f 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToManyRelationshipInResponse.cs @@ -17,7 +17,7 @@ internal sealed class ToManyRelationshipInResponse [Required] [JsonPropertyName("data")] - public ICollection> Data { get; set; } = null!; + public ICollection> Data { get; set; } = null!; [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInRequest.cs index 2ec7e1dc96..3804b1998b 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInRequest.cs @@ -12,5 +12,5 @@ internal sealed class ToOneRelationshipInRequest { [Required] [JsonPropertyName("data")] - public ResourceIdentifier Data { get; set; } = null!; + public ResourceIdentifierInRequest Data { get; set; } = null!; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs index c9f3c0a655..9e9e554109 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Relationships/ToOneRelationshipInResponse.cs @@ -17,7 +17,7 @@ internal sealed class ToOneRelationshipInResponse [Required] [JsonPropertyName("data")] - public ResourceIdentifier Data { get; set; } = null!; + public ResourceIdentifierInResponse Data { get; set; } = null!; [JsonPropertyName("meta")] public Meta Meta { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs index 0b846ea204..4835ab40cc 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInCreateResourceRequest.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using JetBrains.Annotations; using JsonApiDotNetCore.Resources; @@ -8,6 +9,14 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; internal sealed class DataInCreateResourceRequest : ResourceData where TResource : IIdentifiable { + [MinLength(1)] + [JsonPropertyName("id")] + public override string Id { get; set; } = null!; + + [MinLength(1)] + [JsonPropertyName("lid")] + public string Lid { get; set; } = null!; + [JsonPropertyName("attributes")] public AttributesInCreateResourceRequest Attributes { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs index 34645f24aa..e497d67673 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/DataInUpdateResourceRequest.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using JetBrains.Annotations; using JsonApiDotNetCore.Resources; @@ -8,6 +9,14 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; internal sealed class DataInUpdateResourceRequest : ResourceData where TResource : IIdentifiable { + [MinLength(1)] + [JsonPropertyName("id")] + public override string Id { get; set; } = null!; + + [MinLength(1)] + [JsonPropertyName("lid")] + public string Lid { get; set; } = null!; + [JsonPropertyName("attributes")] public AttributesInUpdateResourceRequest Attributes { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipIdentifier.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipIdentifier.cs new file mode 100644 index 0000000000..5fef84a133 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/RelationshipIdentifier.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal sealed class RelationshipIdentifier : ResourceIdentifierInRequest + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("relationship")] + public string Relationship { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceData.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceData.cs index 21fcf96dff..4294a9d629 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceData.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceData.cs @@ -11,7 +11,5 @@ internal abstract class ResourceData : IResourceIdentity [JsonPropertyName("type")] public string Type { get; set; } = null!; - [Required] - [JsonPropertyName("id")] - public string Id { get; set; } = null!; + public abstract string Id { get; set; } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs index 59733d5c88..ccfbb5c1f8 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceDataInResponse.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using JetBrains.Annotations; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Links; @@ -9,6 +10,10 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; internal sealed class ResourceDataInResponse : ResourceData where TResource : IIdentifiable { + [Required] + [JsonPropertyName("id")] + public override string Id { get; set; } = null!; + [JsonPropertyName("attributes")] public AttributesInResponse Attributes { get; set; } = null!; diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInRequest.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInRequest.cs new file mode 100644 index 0000000000..a04552631b --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInRequest.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using JetBrains.Annotations; +using JsonApiDotNetCore.Resources; + +namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; + +// ReSharper disable once UnusedTypeParameter +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +internal class ResourceIdentifierInRequest : IResourceIdentity + where TResource : IIdentifiable +{ + [Required] + [JsonPropertyName("type")] + public string Type { get; set; } = null!; + + [MinLength(1)] + [JsonPropertyName("id")] + public string Id { get; set; } = null!; + + [MinLength(1)] + [JsonPropertyName("lid")] + public string Lid { get; set; } = null!; +} diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifier.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInResponse.cs similarity index 84% rename from src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifier.cs rename to src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInResponse.cs index 3b8b8e5272..3c089242b9 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifier.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiObjects/ResourceObjects/ResourceIdentifierInResponse.cs @@ -5,7 +5,7 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; // ReSharper disable once UnusedTypeParameter -internal sealed class ResourceIdentifier : IResourceIdentity +internal sealed class ResourceIdentifierInResponse : IResourceIdentity where TResource : IIdentifiable { [Required] diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiPropertyName.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiPropertyName.cs index 5c4ad366b3..cdfcec9879 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiPropertyName.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiPropertyName.cs @@ -9,7 +9,11 @@ internal static class JsonApiPropertyName public const string Data = "data"; public const string Type = "type"; public const string Id = "id"; + public const string Lid = "lid"; public const string Attributes = "attributes"; public const string Relationships = "relationships"; + public const string Op = "op"; + public const string Ref = "ref"; + public const string Relationship = "relationship"; public const string Meta = "meta"; } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs index 29d46d6d9e..fe259a393c 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiRequestFormatMetadataProvider.cs @@ -25,14 +25,15 @@ public IReadOnlyList GetSupportedContentTypes(string contentType, Type o ArgumentGuard.NotNullNorEmpty(contentType); ArgumentGuard.NotNull(objectType); - if (contentType == HeaderConstants.MediaType && JsonApiSchemaFacts.IsRequestSchemaType(objectType)) + if (JsonApiSchemaFacts.IsRequestBodySchemaType(objectType) && contentType is HeaderConstants.MediaType or HeaderConstants.AtomicOperationsMediaType or + HeaderConstants.RelaxedAtomicOperationsMediaType) { return new MediaTypeCollection { - new MediaTypeHeaderValue(HeaderConstants.MediaType) + MediaTypeHeaderValue.Parse(contentType) }; } - return new MediaTypeCollection(); + return []; } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs index 20b3377815..3a97d1b892 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaFacts.cs @@ -7,21 +7,22 @@ namespace JsonApiDotNetCore.OpenApi; internal static class JsonApiSchemaFacts { - private static readonly Type[] RequestSchemaTypes = + private static readonly Type[] RequestBodySchemaTypes = [ typeof(CreateResourceRequestDocument<>), typeof(UpdateResourceRequestDocument<>), typeof(ToOneRelationshipInRequest<>), typeof(NullableToOneRelationshipInRequest<>), - typeof(ToManyRelationshipInRequest<>) + typeof(ToManyRelationshipInRequest<>), + typeof(OperationsRequestDocument) ]; private static readonly Type[] SchemaTypesHavingNullableDataProperty = [ - typeof(NullableSecondaryResourceResponseDocument<>), - typeof(NullableResourceIdentifierResponseDocument<>), typeof(NullableToOneRelationshipInRequest<>), - typeof(NullableToOneRelationshipInResponse<>) + typeof(NullableToOneRelationshipInResponse<>), + typeof(NullableSecondaryResourceResponseDocument<>), + typeof(NullableResourceIdentifierResponseDocument<>) ]; private static readonly Type[] RelationshipInResponseSchemaTypes = @@ -31,10 +32,10 @@ internal static class JsonApiSchemaFacts typeof(NullableToOneRelationshipInResponse<>) ]; - public static bool IsRequestSchemaType(Type schemaType) + public static bool IsRequestBodySchemaType(Type schemaType) { Type lookupType = schemaType.ConstructedToOpenType(); - return RequestSchemaTypes.Contains(lookupType); + return RequestBodySchemaTypes.Contains(lookupType); } public static bool HasNullableDataProperty(Type schemaType) diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs index 2a91ebf0b2..782881dc8c 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs +++ b/src/JsonApiDotNetCore.OpenApi/JsonApiSchemaIdSelector.cs @@ -1,9 +1,12 @@ using System.Text.Json; using Humanizer; using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Relationships; using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources.Annotations; +using JsonApiDotNetCore.Serialization.Objects; namespace JsonApiDotNetCore.OpenApi; @@ -12,7 +15,19 @@ internal sealed class JsonApiSchemaIdSelector private const string ResourceTypeSchemaIdTemplate = "[ResourceName] Resource Type"; private const string MetaSchemaIdTemplate = "Meta"; - private static readonly IDictionary TypeToSchemaTemplateMap = new Dictionary + private const string AtomicOperationDiscriminatorNameTemplate = "Operation Discriminator"; + private const string ResourceAtomicOperationDiscriminatorValueTemplate = "[OperationCode] [ResourceName]"; + private const string UpdateRelationshipAtomicOperationDiscriminatorValueTemplate = "Update [ResourceName] [RelationshipName]"; + private const string AddToRelationshipAtomicOperationDiscriminatorValueTemplate = "Add To [ResourceName] [RelationshipName]"; + private const string RemoveFromRelationshipAtomicOperationDiscriminatorValueTemplate = "Remove From [ResourceName] [RelationshipName]"; + + private const string UpdateRelationshipAtomicOperationSchemaIdTemplate = "Update [ResourceName] [RelationshipName] Relationship Operation"; + private const string AddToRelationshipAtomicOperationSchemaIdTemplate = "Add To [ResourceName] [RelationshipName] Relationship Operation"; + private const string RemoveFromRelationshipAtomicOperationSchemaIdTemplate = "Remove From [ResourceName] [RelationshipName] Relationship Operation"; + private const string RelationshipIdentifierSchemaIdTemplate = "[ResourceName] [RelationshipName] Relationship Identifier"; + private const string RelationshipNameSchemaIdTemplate = "[ResourceName] [RelationshipName] Relationship Name"; + + private static readonly IDictionary SchemaTypeToTemplateMap = new Dictionary { [typeof(CreateResourceRequestDocument<>)] = "Create [ResourceName] Request Document", [typeof(UpdateResourceRequestDocument<>)] = "Update [ResourceName] Request Document", @@ -39,7 +54,15 @@ internal sealed class JsonApiSchemaIdSelector [typeof(ResourceDataInResponse<>)] = "[ResourceName] Data In Response", [typeof(AttributesInResponse<>)] = "[ResourceName] Attributes In Response", [typeof(RelationshipsInResponse<>)] = "[ResourceName] Relationships In Response", - [typeof(ResourceIdentifier<>)] = "[ResourceName] Identifier" + [typeof(ResourceIdentifierInRequest<>)] = "[ResourceName] Identifier In Request", + [typeof(ResourceIdentifierInResponse<>)] = "[ResourceName] Identifier In Response", + [typeof(CreateResourceOperation<>)] = "Create [ResourceName] Operation", + [typeof(UpdateResourceOperation<>)] = "Update [ResourceName] Operation", + [typeof(DeleteResourceOperation<>)] = "Delete [ResourceName] Operation", + [typeof(UpdateToOneRelationshipOperation<>)] = "Temporary Update [ResourceName] To One Relationship Operation", + [typeof(UpdateToManyRelationshipOperation<>)] = "Temporary Update [ResourceName] To Many Relationship Operation", + [typeof(AddToRelationshipOperation<>)] = "Temporary Add To [ResourceName] To Many Relationship Operation", + [typeof(RemoveFromRelationshipOperation<>)] = "Temporary Remove From [ResourceName] To Many Relationship Operation" }; private readonly IResourceGraph _resourceGraph; @@ -69,31 +92,46 @@ public string GetSchemaId(Type type) if (openType != type) { - if (TypeToSchemaTemplateMap.TryGetValue(openType, out string? schemaTemplate)) + if (SchemaTypeToTemplateMap.TryGetValue(openType, out string? schemaTemplate)) { Type resourceClrType = type.GetGenericArguments().First(); resourceType = _resourceGraph.GetResourceType(resourceClrType); - return ApplySchemaTemplate(schemaTemplate, resourceType); + return ApplySchemaTemplate(schemaTemplate, resourceType, null, null); } } else { - if (TypeToSchemaTemplateMap.TryGetValue(type, out string? schemaTemplate)) + if (SchemaTypeToTemplateMap.TryGetValue(type, out string? schemaTemplate)) { - return ApplySchemaTemplate(schemaTemplate, null); + return ApplySchemaTemplate(schemaTemplate, null, null, null); } } // Used for a fixed set of non-generic types, such as Jsonapi, ResourceCollectionTopLevelLinks etc. - return ApplySchemaTemplate(type.Name, null); + return ApplySchemaTemplate(type.Name, null, null, null); } - private string ApplySchemaTemplate(string schemaTemplate, ResourceType? resourceType) + private string ApplySchemaTemplate(string schemaTemplate, ResourceType? resourceType, string? relationshipName, AtomicOperationCode? operationCode) { - string pascalCaseSchemaId = resourceType != null - ? schemaTemplate.Replace("[ResourceName]", resourceType.PublicName.Singularize()).ToPascalCase() - : schemaTemplate.ToPascalCase(); + string schemaId = schemaTemplate; + + if (resourceType != null) + { + schemaId = schemaId.Replace("[ResourceName]", resourceType.PublicName.Singularize()).ToPascalCase(); + } + + if (relationshipName != null) + { + schemaId = schemaId.Replace("[RelationshipName]", relationshipName.ToPascalCase()); + } + + if (operationCode != null) + { + schemaId = schemaId.Replace("[OperationCode]", operationCode.Value.ToString().ToPascalCase()); + } + + string pascalCaseSchemaId = schemaId.ToPascalCase(); JsonNamingPolicy? namingPolicy = _options.SerializerOptions.PropertyNamingPolicy; return namingPolicy != null ? namingPolicy.ConvertName(pascalCaseSchemaId) : pascalCaseSchemaId; @@ -103,11 +141,70 @@ public string GetResourceTypeSchemaId(ResourceType resourceType) { ArgumentGuard.NotNull(resourceType); - return ApplySchemaTemplate(ResourceTypeSchemaIdTemplate, resourceType); + return ApplySchemaTemplate(ResourceTypeSchemaIdTemplate, resourceType, null, null); } public string GetMetaSchemaId() { - return ApplySchemaTemplate(MetaSchemaIdTemplate, null); + return ApplySchemaTemplate(MetaSchemaIdTemplate, null, null, null); + } + + public string GetAtomicOperationCodeSchemaId(AtomicOperationCode operationCode) + { + return ApplySchemaTemplate("[OperationCode] Operation Code", null, null, operationCode); + } + + public string GetAtomicOperationDiscriminatorName() + { + return ApplySchemaTemplate(AtomicOperationDiscriminatorNameTemplate, null, null, null); + } + + public string GetAtomicOperationDiscriminatorValue(AtomicOperationCode operationCode, ResourceType resourceType) + { + ArgumentGuard.NotNull(resourceType); + + return ApplySchemaTemplate(ResourceAtomicOperationDiscriminatorValueTemplate, resourceType, null, operationCode); + } + + public string GetAtomicOperationDiscriminatorValue(AtomicOperationCode operationCode, RelationshipAttribute relationship) + { + ArgumentGuard.NotNull(relationship); + + string schemaIdTemplate = operationCode switch + { + AtomicOperationCode.Add => AddToRelationshipAtomicOperationDiscriminatorValueTemplate, + AtomicOperationCode.Remove => RemoveFromRelationshipAtomicOperationDiscriminatorValueTemplate, + _ => UpdateRelationshipAtomicOperationDiscriminatorValueTemplate + }; + + return ApplySchemaTemplate(schemaIdTemplate, relationship.LeftType, relationship.PublicName, null); + } + + public string GetRelationshipAtomicOperationSchemaId(RelationshipAttribute relationship, AtomicOperationCode operationCode) + { + ArgumentGuard.NotNull(relationship); + + string schemaIdTemplate = operationCode switch + { + AtomicOperationCode.Add => AddToRelationshipAtomicOperationSchemaIdTemplate, + AtomicOperationCode.Remove => RemoveFromRelationshipAtomicOperationSchemaIdTemplate, + _ => UpdateRelationshipAtomicOperationSchemaIdTemplate + }; + + return ApplySchemaTemplate(schemaIdTemplate, relationship.LeftType, relationship.PublicName, null); + } + + public string GetRelationshipIdentifierSchemaId(RelationshipAttribute relationship) + { + ArgumentGuard.NotNull(relationship); + + return ApplySchemaTemplate(RelationshipIdentifierSchemaIdTemplate, relationship.LeftType, relationship.PublicName, null); + } + + public string GetRelationshipNameSchemaId(RelationshipAttribute relationship) + { + ArgumentGuard.NotNull(relationship); + + return ApplySchemaTemplate(RelationshipNameSchemaIdTemplate, relationship.LeftType, relationship.PublicName, null); } } diff --git a/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs index dfbad968b3..00c344b877 100644 --- a/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs @@ -39,19 +39,14 @@ public void Apply(ActionModel action) if (endpoint == null) { - // Not a JSON:API controller, or a non-standard action method in a JSON:API controller, or an atomic:operations - // controller. None of these are yet implemented, so hide them to avoid downstream crashes. + // Not a JSON:API controller, or a non-standard action method in a JSON:API controller. + // None of these are yet implemented, so hide them to avoid downstream crashes. action.ApiExplorer.IsVisible = false; return; } ResourceType? resourceType = _controllerResourceMapping.GetResourceTypeForController(action.Controller.ControllerType); - if (resourceType == null) - { - throw new UnreachableCodeException(); - } - if (ShouldSuppressEndpoint(endpoint.Value, resourceType)) { action.ApiExplorer.IsVisible = false; @@ -62,8 +57,13 @@ public void Apply(ActionModel action) SetRequestMetadata(action, endpoint.Value); } - private bool ShouldSuppressEndpoint(JsonApiEndpoint endpoint, ResourceType resourceType) + private bool ShouldSuppressEndpoint(JsonApiEndpoint endpoint, ResourceType? resourceType) { + if (resourceType == null) + { + return false; + } + if (!IsEndpointAvailable(endpoint, resourceType)) { return true; @@ -127,9 +127,10 @@ private static bool IsSecondaryOrRelationshipEndpoint(JsonApiEndpoint endpoint) JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship; } - private void SetResponseMetadata(ActionModel action, JsonApiEndpoint endpoint, ResourceType resourceType) + private void SetResponseMetadata(ActionModel action, JsonApiEndpoint endpoint, ResourceType? resourceType) { - action.Filters.Add(new ProducesAttribute(HeaderConstants.MediaType)); + string contentType = endpoint == JsonApiEndpoint.PostOperations ? HeaderConstants.RelaxedAtomicOperationsMediaType : HeaderConstants.MediaType; + action.Filters.Add(new ProducesAttribute(contentType)); foreach (HttpStatusCode statusCode in GetSuccessStatusCodesForEndpoint(endpoint)) { @@ -166,13 +167,19 @@ private static IEnumerable GetSuccessStatusCodesForEndpoint(Json [ HttpStatusCode.NoContent ], + JsonApiEndpoint.PostOperations => + [ + HttpStatusCode.OK, + HttpStatusCode.NoContent + ], _ => throw new UnreachableCodeException() }; } - private IEnumerable GetErrorStatusCodesForEndpoint(JsonApiEndpoint endpoint, ResourceType resourceType) + private IEnumerable GetErrorStatusCodesForEndpoint(JsonApiEndpoint endpoint, ResourceType? resourceType) { - ClientIdGenerationMode clientIdGeneration = resourceType.ClientIdGeneration ?? _options.ClientIdGeneration; + // Condition doesn't apply to atomic operations, because Forbidden is also used when an operation is not accessible. + ClientIdGenerationMode clientIdGeneration = resourceType?.ClientIdGeneration ?? _options.ClientIdGeneration; return endpoint switch { @@ -211,6 +218,14 @@ private IEnumerable GetErrorStatusCodesForEndpoint(JsonApiEndpoi HttpStatusCode.NotFound, HttpStatusCode.Conflict }, + JsonApiEndpoint.PostOperations => + [ + HttpStatusCode.BadRequest, + HttpStatusCode.Forbidden, + HttpStatusCode.NotFound, + HttpStatusCode.Conflict, + HttpStatusCode.UnprocessableEntity + ], _ => throw new UnreachableCodeException() }; } @@ -219,13 +234,14 @@ private static void SetRequestMetadata(ActionModel action, JsonApiEndpoint endpo { if (RequiresRequestBody(endpoint)) { - action.Filters.Add(new ConsumesAttribute(HeaderConstants.MediaType)); + string contentType = endpoint == JsonApiEndpoint.PostOperations ? HeaderConstants.RelaxedAtomicOperationsMediaType : HeaderConstants.MediaType; + action.Filters.Add(new ConsumesAttribute(contentType)); } } private static bool RequiresRequestBody(JsonApiEndpoint endpoint) { return endpoint is JsonApiEndpoint.PostResource or JsonApiEndpoint.PatchResource or JsonApiEndpoint.PostRelationship or - JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship; + JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship or JsonApiEndpoint.PostOperations; } } diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs b/src/JsonApiDotNetCore.OpenApi/OpenApiOperationIdSelector.cs similarity index 54% rename from src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs rename to src/JsonApiDotNetCore.OpenApi/OpenApiOperationIdSelector.cs index 919dccfbc3..2bf991f101 100644 --- a/src/JsonApiDotNetCore.OpenApi/JsonApiOperationIdSelector.cs +++ b/src/JsonApiDotNetCore.OpenApi/OpenApiOperationIdSelector.cs @@ -11,34 +11,36 @@ namespace JsonApiDotNetCore.OpenApi; -internal sealed class JsonApiOperationIdSelector +internal sealed class OpenApiOperationIdSelector { - private const string ResourceOperationIdTemplate = "[Method] [PrimaryResourceName]"; - private const string ResourceCollectionOperationIdTemplate = $"{ResourceOperationIdTemplate} Collection"; - private const string SecondaryOperationIdTemplate = $"{ResourceOperationIdTemplate} [RelationshipName]"; - private const string RelationshipOperationIdTemplate = $"{SecondaryOperationIdTemplate} Relationship"; + private const string ResourceIdTemplate = "[Method] [PrimaryResourceName]"; + private const string ResourceCollectionIdTemplate = $"{ResourceIdTemplate} Collection"; + private const string SecondaryResourceIdTemplate = $"{ResourceIdTemplate} [RelationshipName]"; + private const string RelationshipIdTemplate = $"{SecondaryResourceIdTemplate} Relationship"; + private const string AtomicOperationsIdTemplate = "[Method] Operations"; - private static readonly IDictionary DocumentSchemaTypeToOperationIdTemplateMap = new Dictionary + private static readonly IDictionary SchemaOpenTypeToOpenApiOperationIdTemplateMap = new Dictionary { - [typeof(ResourceCollectionResponseDocument<>)] = ResourceCollectionOperationIdTemplate, - [typeof(PrimaryResourceResponseDocument<>)] = ResourceOperationIdTemplate, - [typeof(CreateResourceRequestDocument<>)] = ResourceOperationIdTemplate, - [typeof(UpdateResourceRequestDocument<>)] = ResourceOperationIdTemplate, - [typeof(void)] = ResourceOperationIdTemplate, - [typeof(SecondaryResourceResponseDocument<>)] = SecondaryOperationIdTemplate, - [typeof(NullableSecondaryResourceResponseDocument<>)] = SecondaryOperationIdTemplate, - [typeof(ResourceIdentifierCollectionResponseDocument<>)] = RelationshipOperationIdTemplate, - [typeof(ResourceIdentifierResponseDocument<>)] = RelationshipOperationIdTemplate, - [typeof(NullableResourceIdentifierResponseDocument<>)] = RelationshipOperationIdTemplate, - [typeof(ToOneRelationshipInRequest<>)] = RelationshipOperationIdTemplate, - [typeof(NullableToOneRelationshipInRequest<>)] = RelationshipOperationIdTemplate, - [typeof(ToManyRelationshipInRequest<>)] = RelationshipOperationIdTemplate + [typeof(ResourceCollectionResponseDocument<>)] = ResourceCollectionIdTemplate, + [typeof(PrimaryResourceResponseDocument<>)] = ResourceIdTemplate, + [typeof(CreateResourceRequestDocument<>)] = ResourceIdTemplate, + [typeof(UpdateResourceRequestDocument<>)] = ResourceIdTemplate, + [typeof(void)] = ResourceIdTemplate, + [typeof(SecondaryResourceResponseDocument<>)] = SecondaryResourceIdTemplate, + [typeof(NullableSecondaryResourceResponseDocument<>)] = SecondaryResourceIdTemplate, + [typeof(ResourceIdentifierCollectionResponseDocument<>)] = RelationshipIdTemplate, + [typeof(ResourceIdentifierResponseDocument<>)] = RelationshipIdTemplate, + [typeof(NullableResourceIdentifierResponseDocument<>)] = RelationshipIdTemplate, + [typeof(ToOneRelationshipInRequest<>)] = RelationshipIdTemplate, + [typeof(NullableToOneRelationshipInRequest<>)] = RelationshipIdTemplate, + [typeof(ToManyRelationshipInRequest<>)] = RelationshipIdTemplate, + [typeof(OperationsRequestDocument)] = AtomicOperationsIdTemplate }; private readonly IControllerResourceMapping _controllerResourceMapping; private readonly IJsonApiOptions _options; - public JsonApiOperationIdSelector(IControllerResourceMapping controllerResourceMapping, IJsonApiOptions options) + public OpenApiOperationIdSelector(IControllerResourceMapping controllerResourceMapping, IJsonApiOptions options) { ArgumentGuard.NotNull(controllerResourceMapping); ArgumentGuard.NotNull(options); @@ -47,28 +49,22 @@ public JsonApiOperationIdSelector(IControllerResourceMapping controllerResourceM _options = options; } - public string GetOperationId(ApiDescription endpoint) + public string GetOpenApiOperationId(ApiDescription endpoint) { ArgumentGuard.NotNull(endpoint); MethodInfo actionMethod = endpoint.ActionDescriptor.GetActionMethod(); ResourceType? primaryResourceType = _controllerResourceMapping.GetResourceTypeForController(actionMethod.ReflectedType); - if (primaryResourceType == null) - { - throw new UnreachableCodeException(); - } - string template = GetTemplate(endpoint); - return ApplyTemplate(template, primaryResourceType, endpoint); } private static string GetTemplate(ApiDescription endpoint) { - Type requestDocumentType = GetDocumentType(endpoint); + Type bodyType = GetBodyType(endpoint); - if (!DocumentSchemaTypeToOperationIdTemplateMap.TryGetValue(requestDocumentType, out string? template)) + if (!SchemaOpenTypeToOpenApiOperationIdTemplateMap.TryGetValue(bodyType, out string? template)) { throw new UnreachableCodeException(); } @@ -76,7 +72,7 @@ private static string GetTemplate(ApiDescription endpoint) return template; } - private static Type GetDocumentType(ApiDescription endpoint) + private static Type GetBodyType(ApiDescription endpoint) { var producesResponseTypeAttribute = endpoint.ActionDescriptor.GetFilterMetadata(); @@ -86,17 +82,17 @@ private static Type GetDocumentType(ApiDescription endpoint) } ControllerParameterDescriptor? requestBodyDescriptor = endpoint.ActionDescriptor.GetBodyParameterDescriptor(); - Type documentType = (requestBodyDescriptor?.ParameterType ?? producesResponseTypeAttribute.Type).ConstructedToOpenType(); + Type bodyType = (requestBodyDescriptor?.ParameterType ?? producesResponseTypeAttribute.Type).ConstructedToOpenType(); - if (documentType == typeof(ResourceCollectionResponseDocument<>) && endpoint.ParameterDescriptions.Count > 0) + if (bodyType == typeof(ResourceCollectionResponseDocument<>) && endpoint.ParameterDescriptions.Count > 0) { - documentType = typeof(SecondaryResourceResponseDocument<>); + bodyType = typeof(SecondaryResourceResponseDocument<>); } - return documentType; + return bodyType; } - private string ApplyTemplate(string operationIdTemplate, ResourceType resourceType, ApiDescription endpoint) + private string ApplyTemplate(string openApiOperationIdTemplate, ResourceType? resourceType, ApiDescription endpoint) { if (endpoint.RelativePath == null || endpoint.HttpMethod == null) { @@ -104,14 +100,14 @@ private string ApplyTemplate(string operationIdTemplate, ResourceType resourceTy } string method = endpoint.HttpMethod.ToLowerInvariant(); - string relationshipName = operationIdTemplate.Contains("[RelationshipName]") ? endpoint.RelativePath.Split("/").Last() : string.Empty; + string relationshipName = openApiOperationIdTemplate.Contains("[RelationshipName]") ? endpoint.RelativePath.Split('/').Last() : string.Empty; // @formatter:wrap_chained_method_calls chop_always // @formatter:wrap_before_first_method_call true - string pascalCaseOperationId = operationIdTemplate + string pascalCaseOpenApiOperationId = openApiOperationIdTemplate .Replace("[Method]", method) - .Replace("[PrimaryResourceName]", resourceType.PublicName.Singularize()) + .Replace("[PrimaryResourceName]", resourceType?.PublicName.Singularize()) .Replace("[RelationshipName]", relationshipName) .ToPascalCase(); @@ -119,6 +115,6 @@ private string ApplyTemplate(string operationIdTemplate, ResourceType resourceTy // @formatter:wrap_chained_method_calls restore JsonNamingPolicy? namingPolicy = _options.SerializerOptions.PropertyNamingPolicy; - return namingPolicy != null ? namingPolicy.ConvertName(pascalCaseOperationId) : pascalCaseOperationId; + return namingPolicy != null ? namingPolicy.ConvertName(pascalCaseOpenApiOperationId) : pascalCaseOpenApiOperationId; } } diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/AtomicOperationsBodySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/AtomicOperationsBodySchemaGenerator.cs new file mode 100644 index 0000000000..bffecf1a22 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/AtomicOperationsBodySchemaGenerator.cs @@ -0,0 +1,243 @@ +using JsonApiDotNetCore.AtomicOperations; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Middleware; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; +using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; +using JsonApiDotNetCore.Resources.Annotations; +using JsonApiDotNetCore.Serialization.Objects; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; + +/// +/// Generates the OpenAPI component schema for an atomic:operations request/response body. +/// +internal sealed class AtomicOperationsBodySchemaGenerator : BodySchemaGenerator +{ + private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly AtomicOperationCodeSchemaGenerator _atomicOperationCodeSchemaGenerator; + private readonly ResourceIdentifierSchemaGenerator _resourceIdentifierSchemaGenerator; + private readonly RelationshipIdentifierSchemaGenerator _relationshipIdentifierSchemaGenerator; + private readonly AbstractAtomicOperationSchemaGenerator _abstractAtomicOperationSchemaGenerator; + private readonly DataContainerSchemaGenerator _dataContainerSchemaGenerator; + private readonly IAtomicOperationFilter _atomicOperationFilter; + private readonly JsonApiSchemaIdSelector _jsonApiSchemaIdSelector; + private readonly ResourceFieldValidationMetadataProvider _resourceFieldValidationMetadataProvider; + private readonly IResourceGraph _resourceGraph; + + public AtomicOperationsBodySchemaGenerator(SchemaGenerator defaultSchemaGenerator, AtomicOperationCodeSchemaGenerator atomicOperationCodeSchemaGenerator, + ResourceIdentifierSchemaGenerator resourceIdentifierSchemaGenerator, RelationshipIdentifierSchemaGenerator relationshipIdentifierSchemaGenerator, + AbstractAtomicOperationSchemaGenerator abstractAtomicOperationSchemaGenerator, DataContainerSchemaGenerator dataContainerSchemaGenerator, + MetaSchemaGenerator metaSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IAtomicOperationFilter atomicOperationFilter, + JsonApiSchemaIdSelector jsonApiSchemaIdSelector, ResourceFieldValidationMetadataProvider resourceFieldValidationMetadataProvider, + IResourceGraph resourceGraph, IJsonApiOptions options) + : base(metaSchemaGenerator, linksVisibilitySchemaGenerator, options) + { + ArgumentGuard.NotNull(defaultSchemaGenerator); + ArgumentGuard.NotNull(atomicOperationCodeSchemaGenerator); + ArgumentGuard.NotNull(resourceIdentifierSchemaGenerator); + ArgumentGuard.NotNull(relationshipIdentifierSchemaGenerator); + ArgumentGuard.NotNull(abstractAtomicOperationSchemaGenerator); + ArgumentGuard.NotNull(dataContainerSchemaGenerator); + ArgumentGuard.NotNull(atomicOperationFilter); + ArgumentGuard.NotNull(jsonApiSchemaIdSelector); + ArgumentGuard.NotNull(resourceFieldValidationMetadataProvider); + ArgumentGuard.NotNull(resourceGraph); + ArgumentGuard.NotNull(options); + + _defaultSchemaGenerator = defaultSchemaGenerator; + _atomicOperationCodeSchemaGenerator = atomicOperationCodeSchemaGenerator; + _resourceIdentifierSchemaGenerator = resourceIdentifierSchemaGenerator; + _relationshipIdentifierSchemaGenerator = relationshipIdentifierSchemaGenerator; + _abstractAtomicOperationSchemaGenerator = abstractAtomicOperationSchemaGenerator; + _dataContainerSchemaGenerator = dataContainerSchemaGenerator; + _atomicOperationFilter = atomicOperationFilter; + _jsonApiSchemaIdSelector = jsonApiSchemaIdSelector; + _resourceFieldValidationMetadataProvider = resourceFieldValidationMetadataProvider; + _resourceGraph = resourceGraph; + } + + public override bool CanGenerate(Type modelType) + { + return modelType == typeof(OperationsRequestDocument) || modelType == typeof(OperationsResponseDocument); + } + + protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaRepository schemaRepository) + { + bool isRequestSchema = bodyType == typeof(OperationsRequestDocument); + + if (isRequestSchema) + { + GenerateSchemasForRequestBody(schemaRepository); + } + else + { + GenerateSchemasForResponseBody(schemaRepository); + } + + return _defaultSchemaGenerator.GenerateSchema(bodyType, schemaRepository); + } + + private void GenerateSchemasForRequestBody(SchemaRepository schemaRepository) + { + // There's no way to intercept in the Swashbuckle recursive component schema generation when using schema inheritance, which we need + // to perform generic type expansions. As a workaround, we generate an empty base schema upfront. And each time the schema + // for a derived type is generated, we'll add it to the discriminator mapping. + _ = _abstractAtomicOperationSchemaGenerator.GenerateSchema(schemaRepository); + + foreach (ResourceType resourceType in _resourceGraph.GetResourceTypes()) + { + GenerateSchemaForOperation(resourceType, schemaRepository); + } + } + + private void GenerateSchemaForOperation(ResourceType resourceType, SchemaRepository schemaRepository) + { + GenerateSchemaForResourceOperation(typeof(CreateResourceOperation<>), resourceType, AtomicOperationCode.Add, schemaRepository); + GenerateSchemaForResourceOperation(typeof(UpdateResourceOperation<>), resourceType, AtomicOperationCode.Update, schemaRepository); + GenerateSchemaForResourceOperation(typeof(DeleteResourceOperation<>), resourceType, AtomicOperationCode.Remove, schemaRepository); + + foreach (RelationshipAttribute relationship in resourceType.Relationships) + { + if (relationship is HasOneAttribute) + { + GenerateSchemaForRelationshipOperation(typeof(UpdateToOneRelationshipOperation<>), relationship, AtomicOperationCode.Update, schemaRepository); + } + else + { + GenerateSchemaForRelationshipOperation(typeof(AddToRelationshipOperation<>), relationship, AtomicOperationCode.Add, schemaRepository); + GenerateSchemaForRelationshipOperation(typeof(UpdateToManyRelationshipOperation<>), relationship, AtomicOperationCode.Update, schemaRepository); + GenerateSchemaForRelationshipOperation(typeof(RemoveFromRelationshipOperation<>), relationship, AtomicOperationCode.Remove, schemaRepository); + } + } + } + + private void GenerateSchemaForResourceOperation(Type operationOpenType, ResourceType resourceType, AtomicOperationCode operationCode, + SchemaRepository schemaRepository) + { + WriteOperationKind operationKind = operationCode switch + { + AtomicOperationCode.Add => WriteOperationKind.CreateResource, + AtomicOperationCode.Update => WriteOperationKind.UpdateResource, + AtomicOperationCode.Remove => WriteOperationKind.DeleteResource, + _ => throw new UnreachableCodeException() + }; + + if (!_atomicOperationFilter.IsEnabled(resourceType, operationKind)) + { + return; + } + + _ = _resourceIdentifierSchemaGenerator.GenerateSchema(resourceType, true, schemaRepository); + + Type operationConstructedType = operationOpenType.MakeGenericType(resourceType.ClrType); + bool hasDataProperty = operationOpenType != typeof(DeleteResourceOperation<>); + + if (hasDataProperty) + { + _ = _dataContainerSchemaGenerator.GenerateSchema(operationConstructedType, resourceType, true, schemaRepository); + } + + OpenApiSchema referenceSchemaForOperation = _defaultSchemaGenerator.GenerateSchema(operationConstructedType, schemaRepository); + OpenApiSchema fullSchemaForOperation = schemaRepository.Schemas[referenceSchemaForOperation.Reference.Id]; + fullSchemaForOperation.AdditionalPropertiesAllowed = false; + + OpenApiSchema fullSchemaForDerivedType = fullSchemaForOperation.UnwrapLastExtendedSchema(); + SetOperationCode(fullSchemaForDerivedType, operationCode, schemaRepository); + + string discriminatorValue = _jsonApiSchemaIdSelector.GetAtomicOperationDiscriminatorValue(operationCode, resourceType); + _abstractAtomicOperationSchemaGenerator.MapDiscriminator(referenceSchemaForOperation, discriminatorValue, schemaRepository); + } + + private void GenerateSchemaForRelationshipOperation(Type operationOpenType, RelationshipAttribute relationship, AtomicOperationCode operationCode, + SchemaRepository schemaRepository) + { + WriteOperationKind operationKind = operationCode switch + { + AtomicOperationCode.Add => WriteOperationKind.AddToRelationship, + AtomicOperationCode.Update => WriteOperationKind.SetRelationship, + AtomicOperationCode.Remove => WriteOperationKind.RemoveFromRelationship, + _ => throw new UnreachableCodeException() + }; + + if (!_atomicOperationFilter.IsEnabled(relationship.LeftType, operationKind)) + { + return; + } + + if (relationship is HasOneAttribute hasOneRelationship && !IsToOneRelationshipEnabled(hasOneRelationship, operationKind)) + { + return; + } + + if (relationship is HasManyAttribute hasManyRelationship && !IsToManyRelationshipEnabled(hasManyRelationship, operationKind)) + { + return; + } + + _ = _resourceIdentifierSchemaGenerator.GenerateSchema(relationship.LeftType, true, schemaRepository); + _ = _resourceIdentifierSchemaGenerator.GenerateSchema(relationship.RightType, true, schemaRepository); + + OpenApiSchema referenceSchemaForRelationshipIdentifier = _relationshipIdentifierSchemaGenerator.GenerateSchema(relationship, schemaRepository); + + Type operationConstructedType = operationOpenType.MakeGenericType(relationship.RightType.ClrType); + _ = _dataContainerSchemaGenerator.GenerateSchema(operationConstructedType, relationship.RightType, true, schemaRepository); + + // This complicated implementation that generates a temporary schema stems from the fact that GetSchemaId takes a Type. + // We could feed it a constructed type with TLeftResource and TRightResource, but there's no way to include + // the relationship name because there's no runtime Type available for it. + string schemaId = _jsonApiSchemaIdSelector.GetRelationshipAtomicOperationSchemaId(relationship, operationCode); + + OpenApiSchema referenceSchemaForOperation = _defaultSchemaGenerator.GenerateSchema(operationConstructedType, schemaRepository); + OpenApiSchema fullSchemaForOperation = schemaRepository.Schemas[referenceSchemaForOperation.Reference.Id]; + fullSchemaForOperation.AdditionalPropertiesAllowed = false; + + OpenApiSchema fullSchemaForDerivedType = fullSchemaForOperation.UnwrapLastExtendedSchema(); + SetOperationCode(fullSchemaForDerivedType, operationCode, schemaRepository); + + fullSchemaForDerivedType.Properties[JsonApiPropertyName.Ref] = referenceSchemaForRelationshipIdentifier.WrapInExtendedSchema(); + fullSchemaForDerivedType.Properties[JsonApiPropertyName.Data].Nullable = _resourceFieldValidationMetadataProvider.IsNullable(relationship); + + schemaRepository.ReplaceSchemaId(operationConstructedType, schemaId); + referenceSchemaForOperation.Reference.Id = schemaId; + + string discriminatorValue = _jsonApiSchemaIdSelector.GetAtomicOperationDiscriminatorValue(operationCode, relationship); + _abstractAtomicOperationSchemaGenerator.MapDiscriminator(referenceSchemaForOperation, discriminatorValue, schemaRepository); + } + + private static bool IsToOneRelationshipEnabled(HasOneAttribute relationship, WriteOperationKind writeOperation) + { + return writeOperation switch + { + WriteOperationKind.SetRelationship => relationship.Capabilities.HasFlag(HasOneCapabilities.AllowSet), + _ => throw new UnreachableCodeException() + }; + } + + private static bool IsToManyRelationshipEnabled(HasManyAttribute relationship, WriteOperationKind writeOperation) + { + return writeOperation switch + { + WriteOperationKind.SetRelationship => relationship.Capabilities.HasFlag(HasManyCapabilities.AllowSet), + WriteOperationKind.AddToRelationship => relationship.Capabilities.HasFlag(HasManyCapabilities.AllowAdd), + WriteOperationKind.RemoveFromRelationship => relationship.Capabilities.HasFlag(HasManyCapabilities.AllowRemove), + _ => throw new UnreachableCodeException() + }; + } + + private void SetOperationCode(OpenApiSchema fullSchema, AtomicOperationCode operationCode, SchemaRepository schemaRepository) + { + OpenApiSchema referenceSchema = _atomicOperationCodeSchemaGenerator.GenerateSchema(operationCode, schemaRepository); + fullSchema.Properties[JsonApiPropertyName.Op] = referenceSchema.WrapInExtendedSchema(); + } + + private void GenerateSchemasForResponseBody(SchemaRepository schemaRepository) + { + foreach (ResourceType resourceType in _resourceGraph.GetResourceTypes()) + { + _ = _dataContainerSchemaGenerator.GenerateSchema(typeof(AtomicResult), resourceType, false, schemaRepository); + } + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs index 6e735e6cb7..7fa6a1cfa5 100644 --- a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Bodies/ResourceOrRelationshipBodySchemaGenerator.cs @@ -1,8 +1,6 @@ -using System.Reflection; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents; using JsonApiDotNetCore.OpenApi.JsonApiObjects.Relationships; -using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; using JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; using JsonApiDotNetCore.OpenApi.SwaggerComponents; using Microsoft.OpenApi.Models; @@ -15,7 +13,7 @@ namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Bodies; /// internal sealed class ResourceOrRelationshipBodySchemaGenerator : BodySchemaGenerator { - private static readonly Type[] RequestSchemaTypes = + private static readonly Type[] RequestBodySchemaTypes = [ typeof(CreateResourceRequestDocument<>), typeof(UpdateResourceRequestDocument<>), @@ -24,7 +22,7 @@ internal sealed class ResourceOrRelationshipBodySchemaGenerator : BodySchemaGene typeof(ToManyRelationshipInRequest<>) ]; - private static readonly Type[] ResponseSchemaTypes = + private static readonly Type[] ResponseBodySchemaTypes = [ typeof(ResourceCollectionResponseDocument<>), typeof(PrimaryResourceResponseDocument<>), @@ -36,34 +34,27 @@ internal sealed class ResourceOrRelationshipBodySchemaGenerator : BodySchemaGene ]; private readonly SchemaGenerator _defaultSchemaGenerator; - private readonly AbstractResourceDataSchemaGenerator _abstractResourceDataSchemaGenerator; - private readonly DataSchemaGenerator _dataSchemaGenerator; - private readonly IncludeDependencyScanner _includeDependencyScanner; + private readonly DataContainerSchemaGenerator _dataContainerSchemaGenerator; private readonly IResourceGraph _resourceGraph; - public ResourceOrRelationshipBodySchemaGenerator(SchemaGenerator defaultSchemaGenerator, - AbstractResourceDataSchemaGenerator abstractResourceDataSchemaGenerator, DataSchemaGenerator dataSchemaGenerator, - MetaSchemaGenerator metaSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, - IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph, IJsonApiOptions options) + public ResourceOrRelationshipBodySchemaGenerator(SchemaGenerator defaultSchemaGenerator, DataContainerSchemaGenerator dataContainerSchemaGenerator, + MetaSchemaGenerator metaSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IResourceGraph resourceGraph, + IJsonApiOptions options) : base(metaSchemaGenerator, linksVisibilitySchemaGenerator, options) { ArgumentGuard.NotNull(defaultSchemaGenerator); - ArgumentGuard.NotNull(abstractResourceDataSchemaGenerator); - ArgumentGuard.NotNull(dataSchemaGenerator); - ArgumentGuard.NotNull(includeDependencyScanner); + ArgumentGuard.NotNull(dataContainerSchemaGenerator); ArgumentGuard.NotNull(resourceGraph); _defaultSchemaGenerator = defaultSchemaGenerator; - _abstractResourceDataSchemaGenerator = abstractResourceDataSchemaGenerator; - _dataSchemaGenerator = dataSchemaGenerator; - _includeDependencyScanner = includeDependencyScanner; + _dataContainerSchemaGenerator = dataContainerSchemaGenerator; _resourceGraph = resourceGraph; } public override bool CanGenerate(Type modelType) { Type modelOpenType = modelType.ConstructedToOpenType(); - return RequestSchemaTypes.Contains(modelOpenType) || ResponseSchemaTypes.Contains(modelOpenType); + return RequestBodySchemaTypes.Contains(modelOpenType) || ResponseBodySchemaTypes.Contains(modelOpenType); } protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaRepository schemaRepository) @@ -76,31 +67,10 @@ protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaReposit return referenceSchemaForBody; } - bool isRequestSchema = RequestSchemaTypes.Contains(bodyType.ConstructedToOpenType()); + var resourceTypeInfo = ResourceTypeInfo.Create(bodyType, _resourceGraph); + bool isRequestSchema = RequestBodySchemaTypes.Contains(bodyType.ConstructedToOpenType()); - if (!isRequestSchema) - { - // There's no way to intercept in the Swashbuckle recursive component schema generation when using inheritance, which we need - // to perform generic type expansions. As a workaround, we generate an empty base schema upfront. Each time the schema - // for a derived type is generated, we'll add it to the discriminator mapping. - _ = _abstractResourceDataSchemaGenerator.GenerateSchema(schemaRepository); - } - - Type dataConstructedType = GetInnerTypeOfDataProperty(bodyType); - - if (!isRequestSchema) - { - // Ensure all reachable related resource types are available in the discriminator mapping so includes work. - // Doing this matters when not all endpoints are exposed. - EnsureResourceTypesAreMappedInDiscriminator(dataConstructedType, schemaRepository); - } - - OpenApiSchema referenceSchemaForData = _dataSchemaGenerator.GenerateSchema(dataConstructedType, schemaRepository); - - if (!isRequestSchema) - { - _abstractResourceDataSchemaGenerator.MapDiscriminator(dataConstructedType, referenceSchemaForData, schemaRepository); - } + _ = _dataContainerSchemaGenerator.GenerateSchema(bodyType, resourceTypeInfo.ResourceType, isRequestSchema, schemaRepository); referenceSchemaForBody = _defaultSchemaGenerator.GenerateSchema(bodyType, schemaRepository); OpenApiSchema fullSchemaForBody = schemaRepository.Schemas[referenceSchemaForBody.Reference.Id].UnwrapLastExtendedSchema(); @@ -112,41 +82,4 @@ protected override OpenApiSchema GenerateBodySchema(Type bodyType, SchemaReposit return referenceSchemaForBody; } - - private static Type GetInnerTypeOfDataProperty(Type bodyType) - { - PropertyInfo? dataProperty = bodyType.GetProperty("Data"); - - if (dataProperty == null) - { - throw new UnreachableCodeException(); - } - - return dataProperty.PropertyType.ConstructedToOpenType().IsAssignableTo(typeof(ICollection<>)) - ? dataProperty.PropertyType.GenericTypeArguments[0] - : dataProperty.PropertyType; - } - - private void EnsureResourceTypesAreMappedInDiscriminator(Type dataConstructedType, SchemaRepository schemaRepository) - { - Type dataOpenType = dataConstructedType.GetGenericTypeDefinition(); - - if (dataOpenType == typeof(ResourceDataInResponse<>)) - { - var resourceTypeInfo = ResourceTypeInfo.Create(dataConstructedType, _resourceGraph); - - foreach (ResourceType resourceType in _includeDependencyScanner.GetReachableRelatedTypes(resourceTypeInfo.ResourceType)) - { - EnsureResourceTypeIsMappedInDiscriminator(schemaRepository, resourceType); - } - } - } - - private void EnsureResourceTypeIsMappedInDiscriminator(SchemaRepository schemaRepository, ResourceType resourceType) - { - Type resourceDataConstructedType = typeof(ResourceDataInResponse<>).MakeGenericType(resourceType.ClrType); - OpenApiSchema referenceSchemaForResourceData = _dataSchemaGenerator.GenerateSchema(resourceDataConstructedType, schemaRepository); - - _abstractResourceDataSchemaGenerator.MapDiscriminator(resourceDataConstructedType, referenceSchemaForResourceData, schemaRepository); - } } diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractAtomicOperationSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractAtomicOperationSchemaGenerator.cs new file mode 100644 index 0000000000..5c29c327ec --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractAtomicOperationSchemaGenerator.cs @@ -0,0 +1,79 @@ +using JsonApiDotNetCore.OpenApi.JsonApiObjects.AtomicOperations; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Interfaces; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; + +internal sealed class AbstractAtomicOperationSchemaGenerator +{ + private static readonly Type AtomicOperationAbstractType = typeof(AtomicOperation); + + private readonly MetaSchemaGenerator _metaSchemaGenerator; + private readonly JsonApiSchemaIdSelector _schemaIdSelector; + + public AbstractAtomicOperationSchemaGenerator(MetaSchemaGenerator metaSchemaGenerator, JsonApiSchemaIdSelector schemaIdSelector) + { + ArgumentGuard.NotNull(metaSchemaGenerator); + ArgumentGuard.NotNull(schemaIdSelector); + + _metaSchemaGenerator = metaSchemaGenerator; + _schemaIdSelector = schemaIdSelector; + } + + public OpenApiSchema GenerateSchema(SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.TryLookupByType(AtomicOperationAbstractType, out OpenApiSchema? referenceSchema)) + { + return referenceSchema; + } + + // The discriminator only exists to guide OpenAPI codegen. The property is ignored by JsonApiDotNetCore. + string discriminatorPropertyName = _schemaIdSelector.GetAtomicOperationDiscriminatorName(); + + referenceSchema = _metaSchemaGenerator.GenerateSchema(schemaRepository); + string metaSchemaId = referenceSchema.Reference.Id; + + var fullSchema = new OpenApiSchema + { + Type = "object", + Required = new SortedSet([discriminatorPropertyName]), + Properties = new Dictionary + { + [metaSchemaId] = referenceSchema.WrapInExtendedSchema() + }, + AdditionalPropertiesAllowed = false, + Discriminator = new OpenApiDiscriminator + { + PropertyName = discriminatorPropertyName, + Mapping = new SortedDictionary(StringComparer.Ordinal) + }, + Extensions = new Dictionary + { + ["x-abstract"] = new OpenApiBoolean(true) + } + }; + + string schemaId = _schemaIdSelector.GetSchemaId(AtomicOperationAbstractType); + + referenceSchema = schemaRepository.AddDefinition(schemaId, fullSchema); + schemaRepository.RegisterType(AtomicOperationAbstractType, schemaId); + + return referenceSchema; + } + + public void MapDiscriminator(OpenApiSchema referenceSchemaForOperation, string discriminatorValue, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(referenceSchemaForOperation); + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.TryLookupByType(AtomicOperationAbstractType, out OpenApiSchema? referenceSchemaForAbstractOperation)) + { + OpenApiSchema fullSchemaForAbstractOperation = schemaRepository.Schemas[referenceSchemaForAbstractOperation.Reference.Id]; + fullSchemaForAbstractOperation.Discriminator.Mapping[discriminatorValue] = referenceSchemaForOperation.Reference.ReferenceV3; + } + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs index fca728697a..2a09f76c0a 100644 --- a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AbstractResourceDataSchemaGenerator.cs @@ -37,18 +37,12 @@ public OpenApiSchema GenerateSchema(SchemaRepository schemaRepository) { Required = new HashSet { - "id", "type" }, Type = "object", Properties = new Dictionary { ["type"] = new() - { - MinLength = 1, - Type = "string" - }, - ["id"] = new() { MinLength = 1, Type = "string" diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AtomicOperationCodeSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AtomicOperationCodeSchemaGenerator.cs new file mode 100644 index 0000000000..8bf5244575 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/AtomicOperationCodeSchemaGenerator.cs @@ -0,0 +1,47 @@ +using JsonApiDotNetCore.Serialization.Objects; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; + +internal sealed class AtomicOperationCodeSchemaGenerator +{ + private readonly JsonApiSchemaIdSelector _schemaIdSelector; + + public AtomicOperationCodeSchemaGenerator(JsonApiSchemaIdSelector schemaIdSelector) + { + ArgumentGuard.NotNull(schemaIdSelector); + + _schemaIdSelector = schemaIdSelector; + } + + public OpenApiSchema GenerateSchema(AtomicOperationCode operationCode, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(schemaRepository); + + string schemaId = _schemaIdSelector.GetAtomicOperationCodeSchemaId(operationCode); + + if (schemaRepository.Schemas.ContainsKey(schemaId)) + { + return new OpenApiSchema + { + Reference = new OpenApiReference + { + Id = schemaId, + Type = ReferenceType.Schema + } + }; + } + + string enumValue = operationCode.ToString().ToLowerInvariant(); + + var fullSchema = new OpenApiSchema + { + Type = "string", + Enum = [new OpenApiString(enumValue)] + }; + + return schemaRepository.AddDefinition(schemaId, fullSchema); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataContainerSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataContainerSchemaGenerator.cs new file mode 100644 index 0000000000..3fa9ba1986 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataContainerSchemaGenerator.cs @@ -0,0 +1,115 @@ +using System.Reflection; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.OpenApi.SwaggerComponents; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; + +/// +/// Generates the reference schema for the Data property in a request or response schema, taking schema inheritance into account. +/// +internal sealed class DataContainerSchemaGenerator +{ + private readonly AbstractResourceDataSchemaGenerator _abstractResourceDataSchemaGenerator; + private readonly DataSchemaGenerator _dataSchemaGenerator; + private readonly IncludeDependencyScanner _includeDependencyScanner; + private readonly IResourceGraph _resourceGraph; + + public DataContainerSchemaGenerator(AbstractResourceDataSchemaGenerator abstractResourceDataSchemaGenerator, DataSchemaGenerator dataSchemaGenerator, + IncludeDependencyScanner includeDependencyScanner, IResourceGraph resourceGraph) + { + ArgumentGuard.NotNull(abstractResourceDataSchemaGenerator); + ArgumentGuard.NotNull(dataSchemaGenerator); + ArgumentGuard.NotNull(includeDependencyScanner); + ArgumentGuard.NotNull(resourceGraph); + + _abstractResourceDataSchemaGenerator = abstractResourceDataSchemaGenerator; + _dataSchemaGenerator = dataSchemaGenerator; + _includeDependencyScanner = includeDependencyScanner; + _resourceGraph = resourceGraph; + } + + public OpenApiSchema GenerateSchema(Type dataContainerConstructedType, ResourceType resourceType, bool forRequestSchema, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(dataContainerConstructedType); + ArgumentGuard.NotNull(resourceType); + ArgumentGuard.NotNull(schemaRepository); + + if (!forRequestSchema) + { + // There's no way to intercept in the Swashbuckle recursive component schema generation when using schema inheritance, which we need + // to perform generic type expansions. As a workaround, we generate an empty base schema upfront. And each time the schema + // for a derived type is generated, we'll add it to the discriminator mapping. + _ = _abstractResourceDataSchemaGenerator.GenerateSchema(schemaRepository); + } + + Type dataConstructedType = GetInnerTypeOfDataProperty(dataContainerConstructedType, resourceType); + + if (!forRequestSchema) + { + // Ensure all reachable related resource types are available in the discriminator mapping upfront. + // This is needed to make includes work when not all endpoints are exposed. + EnsureResourceDataInResponseDerivedTypesAreMappedInDiscriminator(dataConstructedType, schemaRepository); + } + + OpenApiSchema referenceSchemaForData = _dataSchemaGenerator.GenerateSchema(dataConstructedType, schemaRepository); + + if (!forRequestSchema) + { + _abstractResourceDataSchemaGenerator.MapDiscriminator(dataConstructedType, referenceSchemaForData, schemaRepository); + } + + return referenceSchemaForData; + } + + private static Type GetInnerTypeOfDataProperty(Type dataContainerConstructedType, ResourceType resourceType) + { + PropertyInfo? dataProperty = dataContainerConstructedType.GetProperty("Data"); + + if (dataProperty == null) + { + throw new UnreachableCodeException(); + } + + Type innerPropertyType = dataProperty.PropertyType.ConstructedToOpenType().IsAssignableTo(typeof(ICollection<>)) + ? dataProperty.PropertyType.GenericTypeArguments[0] + : dataProperty.PropertyType; + + if (innerPropertyType == typeof(ResourceData)) + { + return typeof(ResourceDataInResponse<>).MakeGenericType(resourceType.ClrType); + } + + if (!innerPropertyType.IsGenericType) + { + throw new UnreachableCodeException(); + } + + return innerPropertyType; + } + + private void EnsureResourceDataInResponseDerivedTypesAreMappedInDiscriminator(Type dataConstructedType, SchemaRepository schemaRepository) + { + Type dataOpenType = dataConstructedType.GetGenericTypeDefinition(); + + if (dataOpenType == typeof(ResourceDataInResponse<>)) + { + var resourceTypeInfo = ResourceTypeInfo.Create(dataConstructedType, _resourceGraph); + + foreach (ResourceType resourceType in _includeDependencyScanner.GetReachableRelatedTypes(resourceTypeInfo.ResourceType)) + { + MapResourceDataInResponseDerivedTypeInDiscriminator(resourceType, schemaRepository); + } + } + } + + private void MapResourceDataInResponseDerivedTypeInDiscriminator(ResourceType resourceType, SchemaRepository schemaRepository) + { + Type resourceDataConstructedType = typeof(ResourceDataInResponse<>).MakeGenericType(resourceType.ClrType); + OpenApiSchema referenceSchemaForResourceData = _dataSchemaGenerator.GenerateSchema(resourceDataConstructedType, schemaRepository); + + _abstractResourceDataSchemaGenerator.MapDiscriminator(resourceDataConstructedType, referenceSchemaForResourceData, schemaRepository); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs index 3f92747370..6af2d4a37b 100644 --- a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/DataSchemaGenerator.cs @@ -14,6 +14,7 @@ internal sealed class DataSchemaGenerator [ JsonApiPropertyName.Type, JsonApiPropertyName.Id, + JsonApiPropertyName.Lid, JsonApiPropertyName.Attributes, JsonApiPropertyName.Relationships, JsonApiPropertyName.Links, @@ -22,6 +23,7 @@ internal sealed class DataSchemaGenerator #endif private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly GenerationCacheSchemaGenerator _generationCacheSchemaGenerator; private readonly ResourceTypeSchemaGenerator _resourceTypeSchemaGenerator; private readonly ResourceIdentifierSchemaGenerator _resourceIdentifierSchemaGenerator; private readonly LinksVisibilitySchemaGenerator _linksVisibilitySchemaGenerator; @@ -31,12 +33,14 @@ internal sealed class DataSchemaGenerator private readonly RelationshipTypeFactory _relationshipTypeFactory; private readonly ResourceDocumentationReader _resourceDocumentationReader; - public DataSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeSchemaGenerator resourceTypeSchemaGenerator, - ResourceIdentifierSchemaGenerator resourceIdentifierSchemaGenerator, LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, - IResourceGraph resourceGraph, IJsonApiOptions options, ResourceFieldValidationMetadataProvider resourceFieldValidationMetadataProvider, - RelationshipTypeFactory relationshipTypeFactory, ResourceDocumentationReader resourceDocumentationReader) + public DataSchemaGenerator(SchemaGenerator defaultSchemaGenerator, GenerationCacheSchemaGenerator generationCacheSchemaGenerator, + ResourceTypeSchemaGenerator resourceTypeSchemaGenerator, ResourceIdentifierSchemaGenerator resourceIdentifierSchemaGenerator, + LinksVisibilitySchemaGenerator linksVisibilitySchemaGenerator, IResourceGraph resourceGraph, IJsonApiOptions options, + ResourceFieldValidationMetadataProvider resourceFieldValidationMetadataProvider, RelationshipTypeFactory relationshipTypeFactory, + ResourceDocumentationReader resourceDocumentationReader) { ArgumentGuard.NotNull(defaultSchemaGenerator); + ArgumentGuard.NotNull(generationCacheSchemaGenerator); ArgumentGuard.NotNull(resourceTypeSchemaGenerator); ArgumentGuard.NotNull(resourceIdentifierSchemaGenerator); ArgumentGuard.NotNull(linksVisibilitySchemaGenerator); @@ -47,6 +51,7 @@ public DataSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeS ArgumentGuard.NotNull(resourceDocumentationReader); _defaultSchemaGenerator = defaultSchemaGenerator; + _generationCacheSchemaGenerator = generationCacheSchemaGenerator; _resourceTypeSchemaGenerator = resourceTypeSchemaGenerator; _resourceIdentifierSchemaGenerator = resourceIdentifierSchemaGenerator; _linksVisibilitySchemaGenerator = linksVisibilitySchemaGenerator; @@ -74,10 +79,12 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo var resourceTypeInfo = ResourceTypeInfo.Create(resourceDataConstructedType, _resourceGraph); OpenApiSchema fullSchemaForDerivedType = fullSchemaForResourceData.UnwrapLastExtendedSchema(); + bool isRequestSchema = fullSchemaForDerivedType == fullSchemaForResourceData; - if (fullSchemaForDerivedType == fullSchemaForResourceData) + if (isRequestSchema) { - AdaptResourceIdentity(resourceTypeInfo, fullSchemaForResourceData); + bool hasAtomicOperationsEndpoint = _generationCacheSchemaGenerator.HasAtomicOperationsEndpoint(schemaRepository); + AdaptResourceIdentity(resourceTypeInfo, fullSchemaForResourceData, hasAtomicOperationsEndpoint); SetResourceType(fullSchemaForResourceData, resourceTypeInfo.ResourceType, schemaRepository); } @@ -88,12 +95,12 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo if (fullSchemaForDerivedType.Properties.ContainsKey(JsonApiPropertyName.Attributes)) { - SetResourceAttributes(fullSchemaForDerivedType, fieldSchemaBuilder, schemaRepository); + SetResourceAttributes(fullSchemaForDerivedType, isRequestSchema, fieldSchemaBuilder, schemaRepository); } if (fullSchemaForDerivedType.Properties.ContainsKey(JsonApiPropertyName.Relationships)) { - SetResourceRelationships(fullSchemaForDerivedType, fieldSchemaBuilder, schemaRepository); + SetResourceRelationships(fullSchemaForDerivedType, isRequestSchema, fieldSchemaBuilder, schemaRepository); } _linksVisibilitySchemaGenerator.UpdateSchemaForResource(resourceTypeInfo, fullSchemaForDerivedType, schemaRepository); @@ -105,20 +112,46 @@ public OpenApiSchema GenerateSchema(Type resourceDataConstructedType, SchemaRepo return referenceSchemaForResourceData; } - private void AdaptResourceIdentity(ResourceTypeInfo resourceTypeInfo, OpenApiSchema fullSchemaForResourceData) + private void AdaptResourceIdentity(ResourceTypeInfo resourceTypeInfo, OpenApiSchema fullSchemaForResourceData, bool hasAtomicOperationsEndpoint) { + if (!hasAtomicOperationsEndpoint) + { + fullSchemaForResourceData.Properties.Remove(JsonApiPropertyName.Lid); + } + if (resourceTypeInfo.ResourceDataOpenType == typeof(DataInCreateResourceRequest<>)) { ClientIdGenerationMode clientIdGeneration = resourceTypeInfo.ResourceType.ClientIdGeneration ?? _options.ClientIdGeneration; - if (clientIdGeneration == ClientIdGenerationMode.Forbidden) + if (hasAtomicOperationsEndpoint) + { + if (clientIdGeneration == ClientIdGenerationMode.Forbidden) + { + fullSchemaForResourceData.Properties.Remove(JsonApiPropertyName.Id); + } + else if (clientIdGeneration == ClientIdGenerationMode.Required) + { + fullSchemaForResourceData.Properties.Remove(JsonApiPropertyName.Lid); + fullSchemaForResourceData.Required.Add(JsonApiPropertyName.Id); + } + } + else { - fullSchemaForResourceData.Required.Remove(JsonApiPropertyName.Id); - fullSchemaForResourceData.Properties.Remove(JsonApiPropertyName.Id); + if (clientIdGeneration == ClientIdGenerationMode.Forbidden) + { + fullSchemaForResourceData.Properties.Remove(JsonApiPropertyName.Id); + } + else if (clientIdGeneration == ClientIdGenerationMode.Required) + { + fullSchemaForResourceData.Required.Add(JsonApiPropertyName.Id); + } } - else if (clientIdGeneration == ClientIdGenerationMode.Allowed) + } + else + { + if (!hasAtomicOperationsEndpoint) { - fullSchemaForResourceData.Required.Remove(JsonApiPropertyName.Id); + fullSchemaForResourceData.Required.Add(JsonApiPropertyName.Id); } } } @@ -129,12 +162,13 @@ private void SetResourceType(OpenApiSchema fullSchemaForResourceData, ResourceTy fullSchemaForResourceData.Properties[JsonApiPropertyName.Type] = referenceSchema.WrapInExtendedSchema(); } - private void SetResourceAttributes(OpenApiSchema fullSchemaForResourceData, ResourceFieldSchemaBuilder builder, SchemaRepository schemaRepository) + private void SetResourceAttributes(OpenApiSchema fullSchemaForResourceData, bool forRequestSchema, ResourceFieldSchemaBuilder builder, + SchemaRepository schemaRepository) { OpenApiSchema referenceSchemaForAttributes = fullSchemaForResourceData.Properties[JsonApiPropertyName.Attributes].UnwrapLastExtendedSchema(); OpenApiSchema fullSchemaForAttributes = schemaRepository.Schemas[referenceSchemaForAttributes.Reference.Id]; - builder.SetMembersOfAttributes(fullSchemaForAttributes, schemaRepository); + builder.SetMembersOfAttributes(fullSchemaForAttributes, forRequestSchema, schemaRepository); if (!fullSchemaForAttributes.Properties.Any()) { @@ -146,12 +180,13 @@ private void SetResourceAttributes(OpenApiSchema fullSchemaForResourceData, Reso } } - private void SetResourceRelationships(OpenApiSchema fullSchemaForResourceData, ResourceFieldSchemaBuilder builder, SchemaRepository schemaRepository) + private void SetResourceRelationships(OpenApiSchema fullSchemaForResourceData, bool forRequestSchema, ResourceFieldSchemaBuilder builder, + SchemaRepository schemaRepository) { OpenApiSchema referenceSchemaForRelationships = fullSchemaForResourceData.Properties[JsonApiPropertyName.Relationships].UnwrapLastExtendedSchema(); OpenApiSchema fullSchemaForRelationships = schemaRepository.Schemas[referenceSchemaForRelationships.Reference.Id]; - builder.SetMembersOfRelationships(fullSchemaForRelationships, schemaRepository); + builder.SetMembersOfRelationships(fullSchemaForRelationships, forRequestSchema, schemaRepository); if (!fullSchemaForRelationships.Properties.Any()) { diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs index 953df234cf..dae143eca4 100644 --- a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/LinksVisibilitySchemaGenerator.cs @@ -39,6 +39,7 @@ internal sealed class LinksVisibilitySchemaGenerator [typeof(NullableResourceIdentifierResponseDocument<>)] = ResourceIdentifierTopLinkTypes, [typeof(ResourceIdentifierCollectionResponseDocument<>)] = ResourceIdentifierCollectionTopLinkTypes, [typeof(ErrorResponseDocument)] = ErrorTopLinkTypes, + [typeof(OperationsResponseDocument)] = ResourceTopLinkTypes, [typeof(NullableToOneRelationshipInResponse<>)] = RelationshipLinkTypes, [typeof(ToManyRelationshipInResponse<>)] = RelationshipLinkTypes, [typeof(ToOneRelationshipInResponse<>)] = RelationshipLinkTypes, diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipIdentifierSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipIdentifierSchemaGenerator.cs new file mode 100644 index 0000000000..fb29b39d68 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipIdentifierSchemaGenerator.cs @@ -0,0 +1,83 @@ +using JsonApiDotNetCore.OpenApi.JsonApiObjects.ResourceObjects; +using JsonApiDotNetCore.Resources.Annotations; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; + +internal sealed class RelationshipIdentifierSchemaGenerator +{ +#if NET6_0 + private static readonly string[] RelationshipIdentifierPropertyNamesInOrder = + [ + JsonApiPropertyName.Type, + JsonApiPropertyName.Id, + JsonApiPropertyName.Lid, + JsonApiPropertyName.Relationship + ]; +#endif + + private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly ResourceTypeSchemaGenerator _resourceTypeSchemaGenerator; + private readonly RelationshipNameSchemaGenerator _relationshipNameSchemaGenerator; + private readonly JsonApiSchemaIdSelector _jsonApiSchemaIdSelector; + + public RelationshipIdentifierSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeSchemaGenerator resourceTypeSchemaGenerator, + RelationshipNameSchemaGenerator relationshipNameSchemaGenerator, JsonApiSchemaIdSelector jsonApiSchemaIdSelector) + { + ArgumentGuard.NotNull(defaultSchemaGenerator); + ArgumentGuard.NotNull(resourceTypeSchemaGenerator); + ArgumentGuard.NotNull(relationshipNameSchemaGenerator); + ArgumentGuard.NotNull(jsonApiSchemaIdSelector); + + _defaultSchemaGenerator = defaultSchemaGenerator; + _resourceTypeSchemaGenerator = resourceTypeSchemaGenerator; + _relationshipNameSchemaGenerator = relationshipNameSchemaGenerator; + _jsonApiSchemaIdSelector = jsonApiSchemaIdSelector; + } + + public OpenApiSchema GenerateSchema(RelationshipAttribute relationship, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(relationship); + ArgumentGuard.NotNull(schemaRepository); + + string schemaId = _jsonApiSchemaIdSelector.GetRelationshipIdentifierSchemaId(relationship); + + if (schemaRepository.Schemas.ContainsKey(schemaId)) + { + return new OpenApiSchema + { + Reference = new OpenApiReference + { + Id = schemaId, + Type = ReferenceType.Schema + } + }; + } + + Type relationshipIdentifierConstructedType = typeof(RelationshipIdentifier<>).MakeGenericType(relationship.LeftType.ClrType); + + if (schemaRepository.TryLookupByType(relationshipIdentifierConstructedType, out _)) + { + throw new UnreachableCodeException(); + } + + OpenApiSchema referenceSchemaForIdentifier = _defaultSchemaGenerator.GenerateSchema(relationshipIdentifierConstructedType, schemaRepository); + OpenApiSchema fullSchemaForIdentifier = schemaRepository.Schemas[referenceSchemaForIdentifier.Reference.Id]; + + OpenApiSchema referenceSchemaForResourceType = _resourceTypeSchemaGenerator.GenerateSchema(relationship.LeftType, schemaRepository); + fullSchemaForIdentifier.Properties[JsonApiPropertyName.Type] = referenceSchemaForResourceType.WrapInExtendedSchema(); + + OpenApiSchema referenceSchemaForRelationshipName = _relationshipNameSchemaGenerator.GenerateSchema(relationship, schemaRepository); + fullSchemaForIdentifier.Properties[JsonApiPropertyName.Relationship] = referenceSchemaForRelationshipName.WrapInExtendedSchema(); + +#if NET6_0 + fullSchemaForIdentifier.ReorderProperties(RelationshipIdentifierPropertyNamesInOrder); +#endif + + schemaRepository.ReplaceSchemaId(relationshipIdentifierConstructedType, schemaId); + referenceSchemaForIdentifier.Reference.Id = schemaId; + + return referenceSchemaForIdentifier; + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipNameSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipNameSchemaGenerator.cs new file mode 100644 index 0000000000..ba8d7e8861 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/RelationshipNameSchemaGenerator.cs @@ -0,0 +1,47 @@ +using JsonApiDotNetCore.Resources.Annotations; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; + +internal sealed class RelationshipNameSchemaGenerator +{ + private readonly JsonApiSchemaIdSelector _schemaIdSelector; + + public RelationshipNameSchemaGenerator(JsonApiSchemaIdSelector schemaIdSelector) + { + ArgumentGuard.NotNull(schemaIdSelector); + + _schemaIdSelector = schemaIdSelector; + } + + public OpenApiSchema GenerateSchema(RelationshipAttribute relationship, SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(relationship); + ArgumentGuard.NotNull(schemaRepository); + + string schemaId = _schemaIdSelector.GetRelationshipNameSchemaId(relationship); + + if (schemaRepository.Schemas.ContainsKey(schemaId)) + { + return new OpenApiSchema + { + Reference = new OpenApiReference + { + Id = schemaId, + Type = ReferenceType.Schema + } + }; + } + + var fullSchema = new OpenApiSchema + { + Type = "string", + Enum = [new OpenApiString(relationship.PublicName)], + AdditionalPropertiesAllowed = false + }; + + return schemaRepository.AddDefinition(schemaId, fullSchema); + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs index 4e100d05f1..c1eb88714d 100644 --- a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/Components/ResourceIdentifierSchemaGenerator.cs @@ -8,29 +8,40 @@ namespace JsonApiDotNetCore.OpenApi.SchemaGenerators.Components; internal sealed class ResourceIdentifierSchemaGenerator { private readonly SchemaGenerator _defaultSchemaGenerator; + private readonly GenerationCacheSchemaGenerator _generationCacheSchemaGenerator; private readonly ResourceTypeSchemaGenerator _resourceTypeSchemaGenerator; - public ResourceIdentifierSchemaGenerator(SchemaGenerator defaultSchemaGenerator, ResourceTypeSchemaGenerator resourceTypeSchemaGenerator) + public ResourceIdentifierSchemaGenerator(SchemaGenerator defaultSchemaGenerator, GenerationCacheSchemaGenerator generationCacheSchemaGenerator, + ResourceTypeSchemaGenerator resourceTypeSchemaGenerator) { ArgumentGuard.NotNull(defaultSchemaGenerator); + ArgumentGuard.NotNull(generationCacheSchemaGenerator); ArgumentGuard.NotNull(resourceTypeSchemaGenerator); _defaultSchemaGenerator = defaultSchemaGenerator; + _generationCacheSchemaGenerator = generationCacheSchemaGenerator; _resourceTypeSchemaGenerator = resourceTypeSchemaGenerator; } - public OpenApiSchema GenerateSchema(ResourceType resourceType, SchemaRepository schemaRepository) + public OpenApiSchema GenerateSchema(ResourceType resourceType, bool forRequestSchema, SchemaRepository schemaRepository) { ArgumentGuard.NotNull(resourceType); ArgumentGuard.NotNull(schemaRepository); - Type resourceIdentifierConstructedType = typeof(ResourceIdentifier<>).MakeGenericType(resourceType.ClrType); + Type resourceIdentifierOpenType = forRequestSchema ? typeof(ResourceIdentifierInRequest<>) : typeof(ResourceIdentifierInResponse<>); + Type resourceIdentifierConstructedType = resourceIdentifierOpenType.MakeGenericType(resourceType.ClrType); if (!schemaRepository.TryLookupByType(resourceIdentifierConstructedType, out OpenApiSchema? referenceSchemaForIdentifier)) { referenceSchemaForIdentifier = _defaultSchemaGenerator.GenerateSchema(resourceIdentifierConstructedType, schemaRepository); OpenApiSchema fullSchemaForIdentifier = schemaRepository.Schemas[referenceSchemaForIdentifier.Reference.Id]; + if (forRequestSchema && !_generationCacheSchemaGenerator.HasAtomicOperationsEndpoint(schemaRepository)) + { + fullSchemaForIdentifier.Properties.Remove(JsonApiPropertyName.Lid); + fullSchemaForIdentifier.Required.Add(JsonApiPropertyName.Id); + } + OpenApiSchema referenceSchemaForResourceType = _resourceTypeSchemaGenerator.GenerateSchema(resourceType, schemaRepository); fullSchemaForIdentifier.Properties[JsonApiPropertyName.Type] = referenceSchemaForResourceType.WrapInExtendedSchema(); } diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/GenerationCacheSchemaGenerator.cs b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/GenerationCacheSchemaGenerator.cs new file mode 100644 index 0000000000..c361793db6 --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaGenerators/GenerationCacheSchemaGenerator.cs @@ -0,0 +1,85 @@ +using System.Reflection; +using JsonApiDotNetCore.OpenApi.JsonApiMetadata; +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi.SchemaGenerators; + +/// +/// Provides access to cached state, which is stored in a temporary schema in during schema generation. +/// +internal sealed class GenerationCacheSchemaGenerator +{ + private const string SchemaId = "__JsonApiSchemaGenerationCache__"; + private const string HasAtomicOperationsEndpointPropertyName = "HasAtomicOperationsEndpoint"; + + private readonly IActionDescriptorCollectionProvider _defaultProvider; + private readonly JsonApiEndpointMetadataProvider _jsonApiEndpointMetadataProvider; + + public GenerationCacheSchemaGenerator(IActionDescriptorCollectionProvider defaultProvider, JsonApiEndpointMetadataProvider jsonApiEndpointMetadataProvider) + { + ArgumentGuard.NotNull(defaultProvider); + ArgumentGuard.NotNull(jsonApiEndpointMetadataProvider); + + _defaultProvider = defaultProvider; + _jsonApiEndpointMetadataProvider = jsonApiEndpointMetadataProvider; + } + + public bool HasAtomicOperationsEndpoint(SchemaRepository schemaRepository) + { + OpenApiSchema referenceSchema = GenerateFullSchema(schemaRepository); + + var hasAtomicOperationsEndpoint = (OpenApiBoolean)referenceSchema.Properties[HasAtomicOperationsEndpointPropertyName].Default; + return hasAtomicOperationsEndpoint.Value; + } + + private OpenApiSchema GenerateFullSchema(SchemaRepository schemaRepository) + { + ArgumentGuard.NotNull(schemaRepository); + + if (schemaRepository.Schemas.TryGetValue(SchemaId, out OpenApiSchema? fullSchema)) + { + return fullSchema; + } + + bool hasAtomicOperationsEndpoint = EvaluateHasAtomicOperationsEndpoint(); + + fullSchema = new OpenApiSchema + { + Type = "object", + Properties = new Dictionary + { + [HasAtomicOperationsEndpointPropertyName] = new() + { + Type = "boolean", + Default = new OpenApiBoolean(hasAtomicOperationsEndpoint) + } + } + }; + + schemaRepository.AddDefinition(SchemaId, fullSchema); + return schemaRepository.Schemas[SchemaId]; + } + + private bool EvaluateHasAtomicOperationsEndpoint() + { + IEnumerable actionDescriptors = + _defaultProvider.ActionDescriptors.Items.Where(JsonApiActionDescriptorCollectionProvider.IsVisibleJsonApiEndpoint); + + foreach (ActionDescriptor actionDescriptor in actionDescriptors) + { + MethodInfo actionMethod = actionDescriptor.GetActionMethod(); + JsonApiEndpointMetadataContainer endpointMetadataContainer = _jsonApiEndpointMetadataProvider.Get(actionMethod); + + if (endpointMetadataContainer.RequestMetadata is AtomicOperationsRequestMetadata) + { + return true; + } + } + + return false; + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/SchemaRepositoryExtensions.cs b/src/JsonApiDotNetCore.OpenApi/SchemaRepositoryExtensions.cs new file mode 100644 index 0000000000..dd4cb3296c --- /dev/null +++ b/src/JsonApiDotNetCore.OpenApi/SchemaRepositoryExtensions.cs @@ -0,0 +1,50 @@ +using System.Reflection; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace JsonApiDotNetCore.OpenApi; + +internal static class SchemaRepositoryExtensions +{ + private const string ReservedIdsFieldName = "_reservedIds"; + private static readonly FieldInfo ReservedIdsField; + + static SchemaRepositoryExtensions() + { + FieldInfo? field = typeof(SchemaRepository).GetField(ReservedIdsFieldName, BindingFlags.Instance | BindingFlags.NonPublic); + + if (field == null) + { + throw new InvalidOperationException($"Failed to locate private field '{ReservedIdsFieldName}' " + + $"in type '{typeof(SchemaRepository).FullName}' in assembly '{typeof(SchemaRepository).Assembly.FullName}'."); + } + + if (field.FieldType != typeof(Dictionary)) + { + throw new InvalidOperationException($"Unexpected type '{field.FieldType}' of private field '{ReservedIdsFieldName}' " + + $"in type '{typeof(SchemaRepository).FullName}' in assembly '{typeof(SchemaRepository).Assembly.FullName}'."); + } + + ReservedIdsField = field; + } + + public static void ReplaceSchemaId(this SchemaRepository schemaRepository, Type oldSchemaType, string newSchemaId) + { + ArgumentGuard.NotNull(schemaRepository); + ArgumentGuard.NotNull(oldSchemaType); + ArgumentGuard.NotNullNorEmpty(newSchemaId); + + if (schemaRepository.TryLookupByType(oldSchemaType, out OpenApiSchema? referenceSchema)) + { + string oldSchemaId = referenceSchema.Reference.Id; + + OpenApiSchema fullSchema = schemaRepository.Schemas[oldSchemaId]; + + schemaRepository.Schemas.Remove(oldSchemaId); + schemaRepository.Schemas.Add(newSchemaId, fullSchema); + + var reservedIds = (Dictionary)ReservedIdsField.GetValue(schemaRepository)!; + reservedIds.Remove(oldSchemaType); + } + } +} diff --git a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs index a8c21d992d..a5a5f6d377 100644 --- a/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs +++ b/src/JsonApiDotNetCore.OpenApi/ServiceCollectionExtensions.cs @@ -68,7 +68,7 @@ private static void AddCustomSwaggerComponents(IServiceCollection services) { services.TryAddSingleton(); services.TryAddSingleton(); - services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); } @@ -90,13 +90,20 @@ private static void AddSchemaGenerators(IServiceCollection services) services.TryAddSingleton(); services.TryAddEnumerable(ServiceDescriptor.Singleton()); + services.TryAddEnumerable(ServiceDescriptor.Singleton()); services.TryAddEnumerable(ServiceDescriptor.Singleton()); + services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(); } } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiOperationDocumentationFilter.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentationOpenApiOperationFilter.cs similarity index 94% rename from src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiOperationDocumentationFilter.cs rename to src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentationOpenApiOperationFilter.cs index 95319b5945..04d7048dd9 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiOperationDocumentationFilter.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/DocumentationOpenApiOperationFilter.cs @@ -16,7 +16,7 @@ namespace JsonApiDotNetCore.OpenApi.SwaggerComponents; [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] -internal sealed class JsonApiOperationDocumentationFilter : IOperationFilter +internal sealed class DocumentationOpenApiOperationFilter : IOperationFilter { private const string GetPrimaryName = nameof(BaseJsonApiController, int>.GetAsync); private const string GetSecondaryName = nameof(BaseJsonApiController, int>.GetSecondaryAsync); @@ -27,6 +27,7 @@ internal sealed class JsonApiOperationDocumentationFilter : IOperationFilter private const string PatchRelationshipName = nameof(BaseJsonApiController, int>.PatchRelationshipAsync); private const string DeleteResourceName = nameof(BaseJsonApiController, int>.DeleteAsync); private const string DeleteRelationshipName = nameof(BaseJsonApiController, int>.DeleteRelationshipAsync); + private const string PostOperationsName = nameof(BaseJsonApiOperationsController.PostOperationsAsync); private const string TextCompareETag = "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched."; @@ -56,7 +57,7 @@ internal sealed class JsonApiOperationDocumentationFilter : IOperationFilter private readonly IControllerResourceMapping _controllerResourceMapping; private readonly ResourceFieldValidationMetadataProvider _resourceFieldValidationMetadataProvider; - public JsonApiOperationDocumentationFilter(IJsonApiOptions options, IControllerResourceMapping controllerResourceMapping, + public DocumentationOpenApiOperationFilter(IJsonApiOptions options, IControllerResourceMapping controllerResourceMapping, ResourceFieldValidationMetadataProvider resourceFieldValidationMetadataProvider) { ArgumentGuard.NotNull(options); @@ -81,12 +82,11 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) } MethodInfo actionMethod = context.ApiDescription.ActionDescriptor.GetActionMethod(); + string actionName = context.MethodInfo.Name; ResourceType? resourceType = _controllerResourceMapping.GetResourceTypeForController(actionMethod.ReflectedType); if (resourceType != null) { - string actionName = context.MethodInfo.Name; - switch (actionName) { case GetPrimaryName or PostResourceName or PatchResourceName or DeleteResourceName: @@ -154,6 +154,10 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) } } } + else if (actionName == PostOperationsName) + { + ApplyPostOperations(operation); + } } private static void ApplyGetPrimary(OpenApiOperation operation, ResourceType resourceType, bool hasHeadVerb) @@ -570,4 +574,23 @@ private static void AddRequestHeaderIfNoneMatch(OpenApiOperation operation) } }); } + + private static void ApplyPostOperations(OpenApiOperation operation) + { + SetOperationSummary(operation, "Performs multiple mutations in a linear and atomic manner."); + + SetRequestBodyDescription(operation.RequestBody, + "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/)."); + + SetResponseDescription(operation.Responses, HttpStatusCode.OK, "All operations were successfully applied, which resulted in additional changes."); + + SetResponseDescription(operation.Responses, HttpStatusCode.NoContent, + "All operations were successfully applied, which did not result in additional changes."); + + SetResponseDescription(operation.Responses, HttpStatusCode.BadRequest, TextRequestBodyBad); + SetResponseDescription(operation.Responses, HttpStatusCode.Forbidden, "An operation is not accessible or a client-generated ID is used."); + SetResponseDescription(operation.Responses, HttpStatusCode.NotFound, "A resource or a related resource does not exist."); + SetResponseDescription(operation.Responses, HttpStatusCode.Conflict, TextConflict); + SetResponseDescription(operation.Responses, HttpStatusCode.UnprocessableEntity, TextRequestBodyValidationFailed); + } } diff --git a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs index e2e25b9bb2..eeb3017cbd 100644 --- a/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs +++ b/src/JsonApiDotNetCore.OpenApi/SwaggerComponents/ResourceFieldSchemaBuilder.cs @@ -53,7 +53,7 @@ private IDictionary GetFieldSchemas() return fullSchemaForResource.Properties; } - public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, SchemaRepository schemaRepository) + public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, bool forRequestSchema, SchemaRepository schemaRepository) { ArgumentGuard.NotNull(fullSchemaForAttributes); ArgumentGuard.NotNull(schemaRepository); @@ -66,6 +66,21 @@ public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, Schema if (matchingAttribute != null && matchingAttribute.Capabilities.HasFlag(requiredCapability)) { + if (forRequestSchema) + { + if (matchingAttribute.Property.SetMethod == null) + { + continue; + } + } + else + { + if (matchingAttribute.Property.GetMethod == null) + { + continue; + } + } + bool isInlineSchemaType = resourceFieldSchema.AllOf.Count == 0; // Schemas for types like enum and complex attributes are handled as reference schemas. @@ -74,7 +89,7 @@ public void SetMembersOfAttributes(OpenApiSchema fullSchemaForAttributes, Schema EnsureAttributeSchemaIsExposed(resourceFieldSchema.UnwrapLastExtendedSchema(), matchingAttribute, schemaRepository); } - fullSchemaForAttributes.Properties[matchingAttribute.PublicName] = resourceFieldSchema; + fullSchemaForAttributes.Properties.Add(matchingAttribute.PublicName, resourceFieldSchema); resourceFieldSchema.Nullable = _resourceFieldValidationMetadataProvider.IsNullable(matchingAttribute); @@ -131,7 +146,7 @@ private bool IsFieldRequired(ResourceFieldAttribute field) return isCreateResourceSchemaType && _resourceFieldValidationMetadataProvider.IsRequired(field); } - public void SetMembersOfRelationships(OpenApiSchema fullSchemaForRelationships, SchemaRepository schemaRepository) + public void SetMembersOfRelationships(OpenApiSchema fullSchemaForRelationships, bool forRequestSchema, SchemaRepository schemaRepository) { ArgumentGuard.NotNull(fullSchemaForRelationships); ArgumentGuard.NotNull(schemaRepository); @@ -142,7 +157,7 @@ public void SetMembersOfRelationships(OpenApiSchema fullSchemaForRelationships, if (matchingRelationship != null) { - _ = _resourceIdentifierSchemaGenerator.GenerateSchema(matchingRelationship.RightType, schemaRepository); + _ = _resourceIdentifierSchemaGenerator.GenerateSchema(matchingRelationship.RightType, forRequestSchema, schemaRepository); AddRelationshipSchemaToResourceData(matchingRelationship, fullSchemaForRelationships, schemaRepository); } } diff --git a/src/JsonApiDotNetCore.OpenApi/UnusedComponentSchemaCleaner.cs b/src/JsonApiDotNetCore.OpenApi/UnusedComponentSchemaCleaner.cs index d7d9fa6ac7..fd0e553998 100644 --- a/src/JsonApiDotNetCore.OpenApi/UnusedComponentSchemaCleaner.cs +++ b/src/JsonApiDotNetCore.OpenApi/UnusedComponentSchemaCleaner.cs @@ -13,6 +13,17 @@ namespace JsonApiDotNetCore.OpenApi; internal sealed class UnusedComponentSchemaCleaner : IDocumentFilter { public void Apply(OpenApiDocument document, DocumentFilterContext context) + { + bool hasChanges; + + do + { + hasChanges = Cleanup(document); + } + while (hasChanges); + } + + private static bool Cleanup(OpenApiDocument document) { var visitor = new OpenApiReferenceVisitor(); var walker = new OpenApiWalker(visitor); @@ -29,6 +40,8 @@ public void Apply(OpenApiDocument document, DocumentFilterContext context) { document.Components.Schemas.Remove(schemaId); } + + return unusedSchemaNames.Count > 0; } private sealed class OpenApiReferenceVisitor : OpenApiVisitorBase diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs new file mode 100644 index 0000000000..e34a75d15f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs @@ -0,0 +1,210 @@ +using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiKiotaEndToEndTests.AtomicOperations; + +public sealed class AtomicCreateResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly TestableHttpClientRequestAdapterFactory _requestAdapterFactory; + private readonly OperationsFakers _fakers; + + public AtomicCreateResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _requestAdapterFactory = new TestableHttpClientRequestAdapterFactory(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_create_resource_with_attributes() + { + // Arrange + Teacher newTeacher = _fakers.Teacher.Generate(); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new CreateTeacherOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateTeacherRequest + { + Type = TeacherResourceType.Teachers, + Attributes = new AttributesInCreateTeacherRequest + { + Name = newTeacher.Name, + EmailAddress = newTeacher.EmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(1); + TeacherDataInResponse teacherDataInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + + teacherDataInResponse.Attributes!.Name.Should().Be(newTeacher.Name); + teacherDataInResponse.Attributes.EmailAddress.Should().Be(newTeacher.EmailAddress); + + long newTeacherId = long.Parse(teacherDataInResponse.Id!); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.FirstWithIdAsync(newTeacherId); + + teacherInDatabase.Name.Should().Be(newTeacher.Name); + teacherInDatabase.EmailAddress.Should().Be(newTeacher.EmailAddress); + }); + } + + [Fact] + public async Task Can_create_resource_with_attributes_and_relationships() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + Course existingCourse = _fakers.Course.Generate(); + Enrollment newEnrollment = _fakers.Enrollment.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingStudent, existingCourse); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new CreateEnrollmentOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateEnrollmentRequest + { + Type = EnrollmentResourceType.Enrollments, + Attributes = new AttributesInCreateEnrollmentRequest + { + EnrolledAt = newEnrollment.EnrolledAt + }, + Relationships = new RelationshipsInCreateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId! + } + } + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(1); + EnrollmentDataInResponse enrollmentDataInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + + enrollmentDataInResponse.Attributes!.EnrolledAt.Should().Be((Date)newEnrollment.EnrolledAt); + enrollmentDataInResponse.Attributes.GraduatedAt.Should().BeNull(); + enrollmentDataInResponse.Attributes.HasGraduated.Should().BeFalse(); + + long newEnrollmentId = long.Parse(enrollmentDataInResponse.Id!); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment enrollmentInDatabase = await dbContext.Enrollments.FirstWithIdAsync(newEnrollmentId); + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrollment.EnrolledAt); + enrollmentInDatabase.GraduatedAt.Should().BeNull(); + enrollmentInDatabase.HasGraduated.Should().BeFalse(); + }); + } + + [Fact] + public async Task Can_create_resource_with_client_generated_ID() + { + // Arrange + Course newCourse = _fakers.Course.Generate(); + newCourse.Id = Guid.NewGuid(); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new CreateCourseOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateCourseRequest + { + Type = CourseResourceType.Courses, + Id = newCourse.StringId!, + Attributes = new AttributesInCreateCourseRequest + { + Subject = newCourse.Subject + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Course courseInDatabase = await dbContext.Courses.FirstWithIdAsync(newCourse.Id); + + courseInDatabase.Subject.Should().Be(newCourse.Subject); + courseInDatabase.Description.Should().BeNull(); + }); + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs new file mode 100644 index 0000000000..3e29261ea8 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs @@ -0,0 +1,79 @@ +using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiKiotaEndToEndTests.AtomicOperations; + +public sealed class AtomicDeleteResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly TestableHttpClientRequestAdapterFactory _requestAdapterFactory; + private readonly OperationsFakers _fakers; + + public AtomicDeleteResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _requestAdapterFactory = new TestableHttpClientRequestAdapterFactory(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_delete_resource() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Enrollments.Add(existingEnrollment); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new DeleteEnrollmentOperation + { + Op = RemoveOperationCode.Remove, + Ref = new EnrollmentIdentifierInRequest + { + Type = EnrollmentResourceType.Enrollments, + Id = existingEnrollment.StringId! + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment? enrollmentInDatabase = await dbContext.Enrollments.FirstWithIdOrDefaultAsync(existingEnrollment.Id); + + enrollmentInDatabase.Should().BeNull(); + }); + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs new file mode 100644 index 0000000000..5a6878766b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs @@ -0,0 +1,234 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiKiotaEndToEndTests.AtomicOperations; + +public sealed class AtomicLocalIdTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly TestableHttpClientRequestAdapterFactory _requestAdapterFactory; + private readonly OperationsFakers _fakers; + + public AtomicLocalIdTests(IntegrationTestContext, OperationsDbContext> testContext, ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _requestAdapterFactory = new TestableHttpClientRequestAdapterFactory(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_use_local_IDs() + { + // Arrange + Teacher newTeacher = _fakers.Teacher.Generate(); + Course newCourse = _fakers.Course.Generate(); + newCourse.Id = Guid.NewGuid(); + Student newStudent = _fakers.Student.Generate(); + DateOnly newEnrolledAt = _fakers.Enrollment.Generate().EnrolledAt; + + const string teacherLocalId = "teacher-1"; + const string studentLocalId = "student-1"; + const string enrollmentLocalId = "enrollment-1"; + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new CreateTeacherOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateTeacherRequest + { + Type = TeacherResourceType.Teachers, + Lid = teacherLocalId, + Attributes = new AttributesInCreateTeacherRequest + { + Name = newTeacher.Name, + EmailAddress = newTeacher.EmailAddress + } + } + }, + new CreateCourseOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateCourseRequest + { + Type = CourseResourceType.Courses, + Id = newCourse.StringId!, + Attributes = new AttributesInCreateCourseRequest + { + Subject = newCourse.Subject, + Description = newCourse.Description + } + } + }, + new AddToTeacherTeachesRelationshipOperation + { + Op = AddOperationCode.Add, + Ref = new TeacherTeachesRelationshipIdentifier + { + Type = TeacherResourceType.Teachers, + Lid = teacherLocalId, + Relationship = TeacherTeachesRelationshipName.Teaches + }, + Data = + [ + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = newCourse.StringId! + } + ] + }, + new CreateStudentOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateStudentRequest + { + Type = StudentResourceType.Students, + Lid = studentLocalId, + Attributes = new AttributesInCreateStudentRequest + { + Name = newStudent.Name, + EmailAddress = newStudent.EmailAddress + } + } + }, + new CreateEnrollmentOperation + { + Op = AddOperationCode.Add, + Data = new DataInCreateEnrollmentRequest + { + Type = EnrollmentResourceType.Enrollments, + Lid = enrollmentLocalId, + Attributes = new AttributesInCreateEnrollmentRequest + { + EnrolledAt = newEnrolledAt + }, + Relationships = new RelationshipsInCreateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = newCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Type = StudentResourceType.Students, + Lid = studentLocalId + } + } + } + } + }, + new UpdateStudentMentorRelationshipOperation + { + Op = UpdateOperationCode.Update, + Ref = new StudentMentorRelationshipIdentifier + { + Type = StudentResourceType.Students, + Lid = studentLocalId, + Relationship = StudentMentorRelationshipName.Mentor + }, + Data = new TeacherIdentifierInRequest + { + Type = TeacherResourceType.Teachers, + Lid = teacherLocalId + } + }, + new DeleteTeacherOperation + { + Op = RemoveOperationCode.Remove, + Ref = new TeacherIdentifierInRequest + { + Type = TeacherResourceType.Teachers, + Lid = teacherLocalId + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(7); + + TeacherDataInResponse teacherInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + teacherInResponse.Attributes!.Name.Should().Be(newTeacher.Name); + teacherInResponse.Attributes.EmailAddress.Should().Be(newTeacher.EmailAddress); + long newTeacherId = long.Parse(teacherInResponse.Id!); + + response.AtomicResults.ElementAt(1).Data.Should().BeNull(); + response.AtomicResults.ElementAt(2).Data.Should().BeNull(); + + StudentDataInResponse studentInResponse = response.AtomicResults.ElementAt(3).Data.Should().BeOfType().Which; + studentInResponse.Attributes!.Name.Should().Be(newStudent.Name); + studentInResponse.Attributes.EmailAddress.Should().Be(newStudent.EmailAddress); + long newStudentId = long.Parse(studentInResponse.Id!); + + EnrollmentDataInResponse enrollmentInResponse = response.AtomicResults.ElementAt(4).Data.Should().BeOfType().Which; + enrollmentInResponse.Attributes!.EnrolledAt.Should().Be((Date)newEnrolledAt); + long newEnrollmentId = long.Parse(enrollmentInResponse.Id!); + + response.AtomicResults.ElementAt(5).Data.Should().BeNull(); + response.AtomicResults.ElementAt(6).Data.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher? teacherInDatabase = await dbContext.Teachers.FirstWithIdOrDefaultAsync(newTeacherId); + teacherInDatabase.Should().BeNull(); + + Course courseInDatabase = await dbContext.Courses.Include(course => course.TaughtBy).FirstWithIdAsync(newCourse.Id); + courseInDatabase.Subject.Should().Be(newCourse.Subject); + courseInDatabase.Description.Should().Be(newCourse.Description); + courseInDatabase.TaughtBy.Should().BeEmpty(); + + Student studentInDatabase = await dbContext.Students.Include(student => student.Mentor).FirstWithIdAsync(newStudentId); + studentInDatabase.Name.Should().Be(newStudent.Name); + studentInDatabase.EmailAddress.Should().Be(newStudent.EmailAddress); + studentInDatabase.Mentor.Should().BeNull(); + + // @formatter:wrap_chained_method_calls chop_always + // @formatter:keep_existing_linebreaks true + + Enrollment enrollmentInDatabase = await dbContext.Enrollments + .Include(enrollment => enrollment.Course) + .Include(enrollment => enrollment.Student) + .FirstWithIdAsync(newEnrollmentId); + + // @formatter:keep_existing_linebreaks restore + // @formatter:wrap_chained_method_calls restore + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrolledAt); + enrollmentInDatabase.Course.ShouldNotBeNull(); + enrollmentInDatabase.Course.Id.Should().Be(newCourse.Id); + enrollmentInDatabase.Student.Id.Should().Be(newStudentId); + }); + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs new file mode 100644 index 0000000000..262a388f55 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs @@ -0,0 +1,279 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiKiotaEndToEndTests.AtomicOperations; + +public sealed class AtomicRelationshipTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly TestableHttpClientRequestAdapterFactory _requestAdapterFactory; + private readonly OperationsFakers _fakers; + + public AtomicRelationshipTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _requestAdapterFactory = new TestableHttpClientRequestAdapterFactory(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_update_ToOne_relationship() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + Student existingStudent = _fakers.Student.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingEnrollment, existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new UpdateEnrollmentStudentRelationshipOperation + { + Op = UpdateOperationCode.Update, + Ref = new EnrollmentStudentRelationshipIdentifier + { + Type = EnrollmentResourceType.Enrollments, + Id = existingEnrollment.StringId!, + Relationship = EnrollmentStudentRelationshipName.Student + }, + Data = new StudentIdentifierInRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId! + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment enrollmentInDatabase = await dbContext.Enrollments.Include(enrollment => enrollment.Student).FirstWithIdAsync(existingEnrollment.Id); + + enrollmentInDatabase.Student.ShouldNotBeNull(); + enrollmentInDatabase.Student.Id.Should().Be(existingStudent.Id); + }); + } + + [Fact] + public async Task Can_update_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(1).ToHashSet(); + List existingCourses = _fakers.Course.Generate(2).ToList(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + dbContext.AddRange(existingCourses); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new UpdateTeacherTeachesRelationshipOperation + { + Op = UpdateOperationCode.Update, + Ref = new TeacherTeachesRelationshipIdentifier + { + Id = existingTeacher.StringId!, + Type = TeacherResourceType.Teachers, + Relationship = TeacherTeachesRelationshipName.Teaches + }, + Data = + [ + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourses.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourses.ElementAt(1).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(2); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(1).Id); + }); + } + + [Fact] + public async Task Can_add_to_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(1).ToHashSet(); + List existingCourses = _fakers.Course.Generate(2).ToList(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + dbContext.AddRange(existingCourses); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new AddToTeacherTeachesRelationshipOperation + { + Op = AddOperationCode.Add, + Ref = new TeacherTeachesRelationshipIdentifier + { + Type = TeacherResourceType.Teachers, + Id = existingTeacher.StringId!, + Relationship = TeacherTeachesRelationshipName.Teaches + }, + Data = + [ + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourses.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourses.ElementAt(1).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(3); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingTeacher.Teaches.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(1).Id); + }); + } + + [Fact] + public async Task Can_remove_from_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(3).ToHashSet(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new RemoveFromTeacherTeachesRelationshipOperation + { + Op = RemoveOperationCode.Remove, + Ref = new TeacherTeachesRelationshipIdentifier + { + Type = TeacherResourceType.Teachers, + Id = existingTeacher.StringId!, + Relationship = TeacherTeachesRelationshipName.Teaches + }, + Data = + [ + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingTeacher.Teaches.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingTeacher.Teaches.ElementAt(2).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(1); + teacherInDatabase.Teaches.ElementAt(0).Id.Should().Be(existingTeacher.Teaches.ElementAt(1).Id); + }); + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs new file mode 100644 index 0000000000..b8e61d5688 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs @@ -0,0 +1,261 @@ +using FluentAssertions; +using JsonApiDotNetCore.Resources; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Http.HttpClientLibrary; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiKiotaEndToEndTests.AtomicOperations; + +public sealed class AtomicUpdateResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly TestableHttpClientRequestAdapterFactory _requestAdapterFactory; + private readonly OperationsFakers _fakers; + + public AtomicUpdateResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _requestAdapterFactory = new TestableHttpClientRequestAdapterFactory(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => + { + services.AddSingleton(); + services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); + }); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_update_resource_with_attributes() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + string newName = _fakers.Student.Generate().Name; + string? newEmailAddress = _fakers.Student.Generate().EmailAddress; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Students.Add(existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new UpdateStudentOperation + { + Op = UpdateOperationCode.Update, + Data = new DataInUpdateStudentRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId!, + Attributes = new AttributesInUpdateStudentRequest + { + Name = newName, + EmailAddress = newEmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(1); + StudentDataInResponse studentDataInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + + studentDataInResponse.Id.Should().Be(existingStudent.StringId); + studentDataInResponse.Attributes!.Name.Should().Be(newName); + studentDataInResponse.Attributes.EmailAddress.Should().Be(newEmailAddress); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Student studentInDatabase = await dbContext.Students.FirstWithIdAsync(existingStudent.Id); + + studentInDatabase.Name.Should().Be(newName); + studentInDatabase.EmailAddress.Should().Be(newEmailAddress); + }); + } + + [Fact] + public async Task Can_update_resource_with_attributes_using_ref() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + string? newEmailAddress = _fakers.Student.Generate().EmailAddress; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Students.Add(existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new UpdateStudentOperation + { + Op = UpdateOperationCode.Update, + Ref = new StudentIdentifierInRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId! + }, + Data = new DataInUpdateStudentRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId!, + Attributes = new AttributesInUpdateStudentRequest + { + EmailAddress = newEmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(1); + StudentDataInResponse studentDataInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + + studentDataInResponse.Id.Should().Be(existingStudent.StringId); + studentDataInResponse.Attributes!.Name.Should().Be(existingStudent.Name); + studentDataInResponse.Attributes.EmailAddress.Should().Be(newEmailAddress); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Student studentInDatabase = await dbContext.Students.FirstWithIdAsync(existingStudent.Id); + + studentInDatabase.Name.Should().Be(existingStudent.Name); + studentInDatabase.EmailAddress.Should().Be(newEmailAddress); + }); + } + + [Fact] + public async Task Can_update_resource_with_attributes_and_relationships() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + Student existingStudent = _fakers.Student.Generate(); + Course existingCourse = _fakers.Course.Generate(); + DateOnly newEnrolledAt = _fakers.Enrollment.Generate().EnrolledAt; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingEnrollment, existingStudent, existingCourse); + await dbContext.SaveChangesAsync(); + }); + + using HttpClientRequestAdapter requestAdapter = _requestAdapterFactory.CreateAdapter(_testContext.Factory); + var apiClient = new AtomicOperationsClient(requestAdapter); + + OperationsRequestDocument requestBody = new() + { + AtomicOperations = + [ + new UpdateEnrollmentOperation + { + Op = UpdateOperationCode.Update, + Data = new DataInUpdateEnrollmentRequest + { + Type = EnrollmentResourceType.Enrollments, + Id = existingEnrollment.StringId!, + Attributes = new AttributesInUpdateEnrollmentRequest + { + EnrolledAt = newEnrolledAt + }, + Relationships = new RelationshipsInUpdateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Type = CourseResourceType.Courses, + Id = existingCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Type = StudentResourceType.Students, + Id = existingStudent.StringId! + } + } + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await apiClient.Operations.PostAsync(requestBody); + + // Assert + response.ShouldNotBeNull(); + + response.AtomicResults.ShouldHaveCount(1); + EnrollmentDataInResponse enrollmentDataInResponse = response.AtomicResults.ElementAt(0).Data.Should().BeOfType().Which; + + enrollmentDataInResponse.Id.Should().Be(existingEnrollment.StringId); + enrollmentDataInResponse.Attributes!.EnrolledAt.Should().Be((Date)newEnrolledAt); + enrollmentDataInResponse.Attributes.GraduatedAt.Should().Be((Date)existingEnrollment.GraduatedAt!.Value); + enrollmentDataInResponse.Attributes.HasGraduated.Should().Be(existingEnrollment.HasGraduated); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + // @formatter:wrap_chained_method_calls chop_always + // @formatter:keep_existing_linebreaks true + + Enrollment enrollmentInDatabase = await dbContext.Enrollments + .Include(enrollment => enrollment.Student) + .Include(enrollment => enrollment.Course) + .FirstWithIdAsync(existingEnrollment.Id); + + // @formatter:keep_existing_linebreaks restore + // @formatter:wrap_chained_method_calls restore + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrolledAt); + enrollmentInDatabase.GraduatedAt.Should().Be(existingEnrollment.GraduatedAt); + enrollmentInDatabase.HasGraduated.Should().Be(existingEnrollment.HasGraduated); + + enrollmentInDatabase.Student.ShouldNotBeNull(); + enrollmentInDatabase.Student.Id.Should().Be(existingStudent.Id); + + enrollmentInDatabase.Course.ShouldNotBeNull(); + enrollmentInDatabase.Course.Id.Should().Be(existingCourse.Id); + }); + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/AtomicOperationsClient.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/AtomicOperationsClient.cs new file mode 100644 index 0000000000..f68eb4da04 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/AtomicOperationsClient.cs @@ -0,0 +1,73 @@ +// +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Store; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Serialization.Form; +using Microsoft.Kiota.Serialization.Json; +using Microsoft.Kiota.Serialization.Multipart; +using Microsoft.Kiota.Serialization.Text; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode +{ + /// + /// The main entry point of the SDK, exposes the configuration and the fluent API. + /// + public class AtomicOperationsClient : BaseRequestBuilder + { + /// The courses property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.CoursesRequestBuilder Courses + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.CoursesRequestBuilder(PathParameters, RequestAdapter); + } + /// The enrollments property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.EnrollmentsRequestBuilder Enrollments + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.EnrollmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The operations property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations.OperationsRequestBuilder Operations + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations.OperationsRequestBuilder(PathParameters, RequestAdapter); + } + /// The students property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.StudentsRequestBuilder Students + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.StudentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The teachers property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.TeachersRequestBuilder Teachers + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.TeachersRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// The backing store to use for the models. + /// The request adapter to use to execute the requests. + public AtomicOperationsClient(IRequestAdapter requestAdapter, IBackingStoreFactory backingStore = default) : base(requestAdapter, "{+baseurl}", new Dictionary()) + { + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultSerializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + ApiClientBuilder.RegisterDefaultDeserializer(); + if (string.IsNullOrEmpty(RequestAdapter.BaseUrl)) + { + RequestAdapter.BaseUrl = "http://localhost"; + } + PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl); + RequestAdapter.EnableBackingStore(backingStore); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/CoursesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/CoursesRequestBuilder.cs new file mode 100644 index 0000000000..c543bc5d8b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/CoursesRequestBuilder.cs @@ -0,0 +1,235 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses +{ + /// + /// Builds and executes requests for operations under \courses + /// + public class CoursesRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.courses.item collection + /// The identifier of the course to retrieve. + /// A + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.CoursesItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.CoursesItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CoursesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CoursesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses{?query*}", rawUrl) + { + } + /// + /// Retrieves a collection of courses. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new course. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CoursePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a collection of courses. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Creates a new course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.CoursesRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.CoursesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves a collection of courses. + /// + public class CoursesRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class CoursesRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Creates a new course. + /// + public class CoursesRequestBuilderPostQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/CoursesItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/CoursesItemRequestBuilder.cs new file mode 100644 index 0000000000..5f2675c8fc --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/CoursesItemRequestBuilder.cs @@ -0,0 +1,283 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item +{ + /// + /// Builds and executes requests for operations under \courses\{id} + /// + public class CoursesItemRequestBuilder : BaseRequestBuilder + { + /// The enrollments property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments.EnrollmentsRequestBuilder Enrollments + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments.EnrollmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The relationships property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.RelationshipsRequestBuilder Relationships + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); + } + /// The taughtBy property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy.TaughtByRequestBuilder TaughtBy + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy.TaughtByRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CoursesItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CoursesItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}{?query*}", rawUrl) + { + } + /// + /// Deletes an existing course by its identifier. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an individual course by its identifier. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CoursePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an existing course. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CoursePrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an existing course by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Retrieves an individual course by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Updates an existing course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.CoursesItemRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.CoursesItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves an individual course by its identifier. + /// + public class CoursesItemRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class CoursesItemRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Updates an existing course. + /// + public class CoursesItemRequestBuilderPatchQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Enrollments/EnrollmentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Enrollments/EnrollmentsRequestBuilder.cs new file mode 100644 index 0000000000..7d5d233723 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Enrollments/EnrollmentsRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments +{ + /// + /// Builds and executes requests for operations under \courses\{id}\enrollments + /// + public class EnrollmentsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/enrollments{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/enrollments{?query*}", rawUrl) + { + } + /// + /// Retrieves the related enrollments of an individual course's enrollments relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related enrollments of an individual course's enrollments relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments.EnrollmentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Enrollments.EnrollmentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related enrollments of an individual course's enrollments relationship. + /// + public class EnrollmentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs new file mode 100644 index 0000000000..3c79c56d8b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs @@ -0,0 +1,255 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments +{ + /// + /// Builds and executes requests for operations under \courses\{id}\relationships\enrollments + /// + public class EnrollmentsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships/enrollments{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships/enrollments{?query*}", rawUrl) + { + } + /// + /// Retrieves the related enrollment identities of an individual course's enrollments relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns existing enrollments to the enrollments relationship of an individual course. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds existing enrollments to the enrollments relationship of an individual course. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related enrollment identities of an individual course's enrollments relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns existing enrollments to the enrollments relationship of an individual course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Adds existing enrollments to the enrollments relationship of an individual course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments.EnrollmentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments.EnrollmentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related enrollment identities of an individual course's enrollments relationship. + /// + public class EnrollmentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/RelationshipsRequestBuilder.cs new file mode 100644 index 0000000000..b5a2bc1161 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/RelationshipsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships +{ + /// + /// Builds and executes requests for operations under \courses\{id}\relationships + /// + public class RelationshipsRequestBuilder : BaseRequestBuilder + { + /// The enrollments property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments.EnrollmentsRequestBuilder Enrollments + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.Enrollments.EnrollmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The taughtBy property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy.TaughtByRequestBuilder TaughtBy + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy.TaughtByRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships", rawUrl) + { + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/TaughtBy/TaughtByRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/TaughtBy/TaughtByRequestBuilder.cs new file mode 100644 index 0000000000..de5077e59c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/Relationships/TaughtBy/TaughtByRequestBuilder.cs @@ -0,0 +1,255 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy +{ + /// + /// Builds and executes requests for operations under \courses\{id}\relationships\taughtBy + /// + public class TaughtByRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TaughtByRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships/taughtBy{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TaughtByRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/relationships/taughtBy{?query*}", rawUrl) + { + } + /// + /// Retrieves the related teacher identities of an individual course's taughtBy relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns existing teachers to the taughtBy relationship of an individual course. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds existing teachers to the taughtBy relationship of an individual course. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related teacher identities of an individual course's taughtBy relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns existing teachers to the taughtBy relationship of an individual course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Adds existing teachers to the taughtBy relationship of an individual course. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy.TaughtByRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.Relationships.TaughtBy.TaughtByRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related teacher identities of an individual course's taughtBy relationship. + /// + public class TaughtByRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TaughtByRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/TaughtBy/TaughtByRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/TaughtBy/TaughtByRequestBuilder.cs new file mode 100644 index 0000000000..90fa72d041 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Courses/Item/TaughtBy/TaughtByRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy +{ + /// + /// Builds and executes requests for operations under \courses\{id}\taughtBy + /// + public class TaughtByRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TaughtByRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/taughtBy{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TaughtByRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/courses/{id}/taughtBy{?query*}", rawUrl) + { + } + /// + /// Retrieves the related teachers of an individual course's taughtBy relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related teachers of an individual course's taughtBy relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy.TaughtByRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Courses.Item.TaughtBy.TaughtByRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related teachers of an individual course's taughtBy relationship. + /// + public class TaughtByRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TaughtByRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/EnrollmentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/EnrollmentsRequestBuilder.cs new file mode 100644 index 0000000000..8307be5308 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/EnrollmentsRequestBuilder.cs @@ -0,0 +1,237 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments +{ + /// + /// Builds and executes requests for operations under \enrollments + /// + public class EnrollmentsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.enrollments.item collection + /// The identifier of the enrollment to retrieve. + /// A + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.EnrollmentsItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.EnrollmentsItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments{?query*}", rawUrl) + { + } + /// + /// Retrieves a collection of enrollments. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new enrollment. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a collection of enrollments. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Creates a new enrollment. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.EnrollmentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.EnrollmentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves a collection of enrollments. + /// + public class EnrollmentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Creates a new enrollment. + /// + public class EnrollmentsRequestBuilderPostQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Course/CourseRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Course/CourseRequestBuilder.cs new file mode 100644 index 0000000000..5448b78c89 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Course/CourseRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course +{ + /// + /// Builds and executes requests for operations under \enrollments\{id}\course + /// + public class CourseRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CourseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/course{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CourseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/course{?query*}", rawUrl) + { + } + /// + /// Retrieves the related course of an individual enrollment's course relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related course of an individual enrollment's course relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course.CourseRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course.CourseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related course of an individual enrollment's course relationship. + /// + public class CourseRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class CourseRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/EnrollmentsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/EnrollmentsItemRequestBuilder.cs new file mode 100644 index 0000000000..69294a7704 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/EnrollmentsItemRequestBuilder.cs @@ -0,0 +1,283 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item +{ + /// + /// Builds and executes requests for operations under \enrollments\{id} + /// + public class EnrollmentsItemRequestBuilder : BaseRequestBuilder + { + /// The course property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course.CourseRequestBuilder Course + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Course.CourseRequestBuilder(PathParameters, RequestAdapter); + } + /// The relationships property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.RelationshipsRequestBuilder Relationships + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); + } + /// The student property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student.StudentRequestBuilder Student + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student.StudentRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}{?query*}", rawUrl) + { + } + /// + /// Deletes an existing enrollment by its identifier. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an individual enrollment by its identifier. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an existing enrollment. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an existing enrollment by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Retrieves an individual enrollment by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Updates an existing enrollment. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.EnrollmentsItemRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.EnrollmentsItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves an individual enrollment by its identifier. + /// + public class EnrollmentsItemRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsItemRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Updates an existing enrollment. + /// + public class EnrollmentsItemRequestBuilderPatchQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Course/CourseRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Course/CourseRequestBuilder.cs new file mode 100644 index 0000000000..3ef4048aec --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Course/CourseRequestBuilder.cs @@ -0,0 +1,205 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course +{ + /// + /// Builds and executes requests for operations under \enrollments\{id}\relationships\course + /// + public class CourseRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public CourseRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships/course{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public CourseRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships/course{?query*}", rawUrl) + { + } + /// + /// Retrieves the related course identity of an individual enrollment's course relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns an existing course to the course relationship of an individual enrollment. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related course identity of an individual enrollment's course relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns an existing course to the course relationship of an individual enrollment. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course.CourseRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course.CourseRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related course identity of an individual enrollment's course relationship. + /// + public class CourseRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class CourseRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/RelationshipsRequestBuilder.cs new file mode 100644 index 0000000000..a60188fe2d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/RelationshipsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships +{ + /// + /// Builds and executes requests for operations under \enrollments\{id}\relationships + /// + public class RelationshipsRequestBuilder : BaseRequestBuilder + { + /// The course property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course.CourseRequestBuilder Course + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Course.CourseRequestBuilder(PathParameters, RequestAdapter); + } + /// The student property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student.StudentRequestBuilder Student + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student.StudentRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships", rawUrl) + { + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Student/StudentRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Student/StudentRequestBuilder.cs new file mode 100644 index 0000000000..e2cb2eab5a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Relationships/Student/StudentRequestBuilder.cs @@ -0,0 +1,205 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student +{ + /// + /// Builds and executes requests for operations under \enrollments\{id}\relationships\student + /// + public class StudentRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StudentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships/student{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StudentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/relationships/student{?query*}", rawUrl) + { + } + /// + /// Retrieves the related student identity of an individual enrollment's student relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns an existing student to the student relationship of an individual enrollment. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related student identity of an individual enrollment's student relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns an existing student to the student relationship of an individual enrollment. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student.StudentRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Relationships.Student.StudentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related student identity of an individual enrollment's student relationship. + /// + public class StudentRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class StudentRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Student/StudentRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Student/StudentRequestBuilder.cs new file mode 100644 index 0000000000..f2639bc0b9 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Enrollments/Item/Student/StudentRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student +{ + /// + /// Builds and executes requests for operations under \enrollments\{id}\student + /// + public class StudentRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StudentRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/student{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StudentRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/enrollments/{id}/student{?query*}", rawUrl) + { + } + /// + /// Retrieves the related student of an individual enrollment's student relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related student of an individual enrollment's student relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student.StudentRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Enrollments.Item.Student.StudentRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related student of an individual enrollment's student relationship. + /// + public class StudentRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class StudentRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddOperationCode.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddOperationCode.cs new file mode 100644 index 0000000000..70a562d93e --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum AddOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "add")] + #pragma warning disable CS1591 + Add, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseEnrollmentsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseEnrollmentsRelationshipOperation.cs new file mode 100644 index 0000000000..10cc82b2e7 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseEnrollmentsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToCourseEnrollmentsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseEnrollmentsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseEnrollmentsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseTaughtByRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseTaughtByRelationshipOperation.cs new file mode 100644 index 0000000000..df7f388a83 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToCourseTaughtByRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToCourseTaughtByRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseTaughtByRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseTaughtByRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToStudentEnrollmentsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToStudentEnrollmentsRelationshipOperation.cs new file mode 100644 index 0000000000..85d7ec2863 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToStudentEnrollmentsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToStudentEnrollmentsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToStudentEnrollmentsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToStudentEnrollmentsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherMentorsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherMentorsRelationshipOperation.cs new file mode 100644 index 0000000000..0c949c7332 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherMentorsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToTeacherMentorsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherMentorsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherMentorsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherTeachesRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherTeachesRelationshipOperation.cs new file mode 100644 index 0000000000..9ca33a2f15 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AddToTeacherTeachesRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AddToTeacherTeachesRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherTeachesRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherTeachesRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicOperation.cs new file mode 100644 index 0000000000..fef181fb7d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicOperation.cs @@ -0,0 +1,100 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AtomicOperation : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtomicOperation() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("operationDiscriminator")?.GetStringValue(); + return mappingValue switch + { + "addCourse" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseOperation(), + "addEnrollment" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentOperation(), + "addStudent" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentOperation(), + "addTeacher" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherOperation(), + "addToCourseEnrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseEnrollmentsRelationshipOperation(), + "addToCourseTaughtBy" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToCourseTaughtByRelationshipOperation(), + "addToStudentEnrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToStudentEnrollmentsRelationshipOperation(), + "addToTeacherMentors" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherMentorsRelationshipOperation(), + "addToTeacherTeaches" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddToTeacherTeachesRelationshipOperation(), + "removeCourse" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteCourseOperation(), + "removeEnrollment" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteEnrollmentOperation(), + "removeFromStudentEnrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromStudentEnrollmentsRelationshipOperation(), + "removeFromTeacherMentors" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherMentorsRelationshipOperation(), + "removeFromTeacherTeaches" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherTeachesRelationshipOperation(), + "removeTeacher" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteTeacherOperation(), + "updateCourse" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseOperation(), + "updateCourseEnrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseEnrollmentsRelationshipOperation(), + "updateEnrollment" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentOperation(), + "updateEnrollmentCourse" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentCourseRelationshipOperation(), + "updateEnrollmentStudent" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentStudentRelationshipOperation(), + "updateStudent" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentOperation(), + "updateStudentEnrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentEnrollmentsRelationshipOperation(), + "updateStudentMentor" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentMentorRelationshipOperation(), + "updateTeacher" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherOperation(), + "updateTeacherMentors" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherMentorsRelationshipOperation(), + "updateTeacherTeaches" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherTeachesRelationshipOperation(), + _ => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicResult.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicResult.cs new file mode 100644 index 0000000000..662aceead7 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AtomicResult.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AtomicResult : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AtomicResult() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicResult CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicResult(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateCourseRequest.cs new file mode 100644 index 0000000000..27daedb169 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateCourseRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInCreateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The description property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#nullable restore +#else + public string Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#endif + /// The subject property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#nullable restore +#else + public string Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInCreateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "subject", n => { Subject = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("subject", Subject); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateEnrollmentRequest.cs new file mode 100644 index 0000000000..1a35827670 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateEnrollmentRequest.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInCreateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrolledAt property + public Date? EnrolledAt + { + get { return BackingStore?.Get("enrolledAt"); } + set { BackingStore?.Set("enrolledAt", value); } + } + /// The graduatedAt property + public Date? GraduatedAt + { + get { return BackingStore?.Get("graduatedAt"); } + set { BackingStore?.Set("graduatedAt", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInCreateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrolledAt", n => { EnrolledAt = n.GetDateValue(); } }, + { "graduatedAt", n => { GraduatedAt = n.GetDateValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateValue("enrolledAt", EnrolledAt); + writer.WriteDateValue("graduatedAt", GraduatedAt); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateStudentRequest.cs new file mode 100644 index 0000000000..b9e7f2a2ed --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateStudentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInCreateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInCreateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateTeacherRequest.cs new file mode 100644 index 0000000000..698bc47a7f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInCreateTeacherRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInCreateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInCreateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateCourseRequest.cs new file mode 100644 index 0000000000..48207efc51 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateCourseRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInUpdateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The description property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#nullable restore +#else + public string Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#endif + /// The subject property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#nullable restore +#else + public string Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInUpdateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "subject", n => { Subject = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("subject", Subject); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateEnrollmentRequest.cs new file mode 100644 index 0000000000..3ae2d3d897 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateEnrollmentRequest.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInUpdateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrolledAt property + public Date? EnrolledAt + { + get { return BackingStore?.Get("enrolledAt"); } + set { BackingStore?.Set("enrolledAt", value); } + } + /// The graduatedAt property + public Date? GraduatedAt + { + get { return BackingStore?.Get("graduatedAt"); } + set { BackingStore?.Set("graduatedAt", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInUpdateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrolledAt", n => { EnrolledAt = n.GetDateValue(); } }, + { "graduatedAt", n => { GraduatedAt = n.GetDateValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateValue("enrolledAt", EnrolledAt); + writer.WriteDateValue("graduatedAt", GraduatedAt); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateStudentRequest.cs new file mode 100644 index 0000000000..b79494cc6d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateStudentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInUpdateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInUpdateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateTeacherRequest.cs new file mode 100644 index 0000000000..d6d8642ef1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/AttributesInUpdateTeacherRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AttributesInUpdateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public AttributesInUpdateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseAttributesInResponse.cs new file mode 100644 index 0000000000..bfd992cafa --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseAttributesInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseAttributesInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The description property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#nullable restore +#else + public string Description + { + get { return BackingStore?.Get("description"); } + set { BackingStore?.Set("description", value); } + } +#endif + /// The subject property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#nullable restore +#else + public string Subject + { + get { return BackingStore?.Get("subject"); } + set { BackingStore?.Set("subject", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseAttributesInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseAttributesInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "description", n => { Description = n.GetStringValue(); } }, + { "subject", n => { Subject = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("description", Description); + writer.WriteStringValue("subject", Subject); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseCollectionResponseDocument.cs new file mode 100644 index 0000000000..cbdf926bd3 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseCollectionResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseDataInResponse.cs new file mode 100644 index 0000000000..a545a0ce52 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseDataInResponse.cs @@ -0,0 +1,133 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseDataInResponse : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipIdentifier.cs new file mode 100644 index 0000000000..e0bef652f4 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseEnrollmentsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public CourseEnrollmentsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipName.cs new file mode 100644 index 0000000000..1ac02ad45a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseEnrollmentsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum CourseEnrollmentsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "enrollments")] + #pragma warning disable CS1591 + Enrollments, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierCollectionResponseDocument.cs new file mode 100644 index 0000000000..463e381269 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierCollectionResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseIdentifierCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseIdentifierCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInRequest.cs new file mode 100644 index 0000000000..5b1fa783ff --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public CourseIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInResponse.cs new file mode 100644 index 0000000000..f431ff1ceb --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public CourseIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierResponseDocument.cs new file mode 100644 index 0000000000..d2c49d8637 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseIdentifierResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseIdentifierResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseIdentifierResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CoursePrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CoursePrimaryResponseDocument.cs new file mode 100644 index 0000000000..37e94b59b7 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CoursePrimaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CoursePrimaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CoursePrimaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CoursePrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CoursePrimaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseRelationshipsInResponse.cs new file mode 100644 index 0000000000..1886e06488 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseRelationshipsInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseRelationshipsInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The taughtBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInResponse? TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInResponse TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseRelationshipsInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseRelationshipsInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse.CreateFromDiscriminatorValue); } }, + { "taughtBy", n => { TaughtBy = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("taughtBy", TaughtBy); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseResourceType.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseResourceType.cs new file mode 100644 index 0000000000..13b335698f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseResourceType.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum CourseResourceType + #pragma warning restore CS1591 + { + [EnumMember(Value = "courses")] + #pragma warning disable CS1591 + Courses, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseSecondaryResponseDocument.cs new file mode 100644 index 0000000000..58d574160b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseSecondaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseSecondaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CourseSecondaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseSecondaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipIdentifier.cs new file mode 100644 index 0000000000..2834a12612 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CourseTaughtByRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public CourseTaughtByRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseTaughtByRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipName.cs new file mode 100644 index 0000000000..18e09cfd79 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CourseTaughtByRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum CourseTaughtByRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "taughtBy")] + #pragma warning disable CS1591 + TaughtBy, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseOperation.cs new file mode 100644 index 0000000000..49674a921d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateCourseOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseRequestDocument.cs new file mode 100644 index 0000000000..b8885a7c55 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateCourseRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateCourseRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateCourseRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateCourseRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentOperation.cs new file mode 100644 index 0000000000..7cbdc18681 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateEnrollmentOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentRequestDocument.cs new file mode 100644 index 0000000000..d0cd62007a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateEnrollmentRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateEnrollmentRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateEnrollmentRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateEnrollmentRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentOperation.cs new file mode 100644 index 0000000000..3d4632ff0e --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateStudentOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentRequestDocument.cs new file mode 100644 index 0000000000..a757774381 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateStudentRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateStudentRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateStudentRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherOperation.cs new file mode 100644 index 0000000000..1823eff824 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateTeacherOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AddOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherRequestDocument.cs new file mode 100644 index 0000000000..b71e3c8c14 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/CreateTeacherRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class CreateTeacherRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public CreateTeacherRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateCourseRequest.cs new file mode 100644 index 0000000000..ba79c8c55f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateCourseRequest.cs @@ -0,0 +1,114 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInCreateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateCourseRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateCourseRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateCourseRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateCourseRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInCreateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateCourseRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateCourseRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateEnrollmentRequest.cs new file mode 100644 index 0000000000..72dd1333fb --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateEnrollmentRequest.cs @@ -0,0 +1,114 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInCreateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateEnrollmentRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateEnrollmentRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateEnrollmentRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateEnrollmentRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInCreateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateStudentRequest.cs new file mode 100644 index 0000000000..6870472e5c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateStudentRequest.cs @@ -0,0 +1,114 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInCreateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateStudentRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateStudentRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateStudentRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateStudentRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInCreateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateStudentRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateStudentRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateTeacherRequest.cs new file mode 100644 index 0000000000..8d44370064 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInCreateTeacherRequest.cs @@ -0,0 +1,114 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInCreateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateTeacherRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateTeacherRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateTeacherRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateTeacherRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInCreateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInCreateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInCreateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInResponse.cs new file mode 100644 index 0000000000..6c706fab66 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } +#nullable restore +#else + public string Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public DataInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + var mappingValue = parseNode.GetChildNode("type")?.GetStringValue(); + return mappingValue switch + { + "courses" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseDataInResponse(), + "enrollments" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse(), + "students" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse(), + "teachers" => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse(), + _ => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse(), + }; + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateCourseRequest.cs new file mode 100644 index 0000000000..93858a192c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateCourseRequest.cs @@ -0,0 +1,132 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInUpdateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateCourseRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateCourseRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateCourseRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateCourseRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInUpdateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateCourseRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateCourseRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateEnrollmentRequest.cs new file mode 100644 index 0000000000..150a4e0ea0 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateEnrollmentRequest.cs @@ -0,0 +1,132 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInUpdateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateEnrollmentRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateEnrollmentRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateEnrollmentRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateEnrollmentRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInUpdateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateStudentRequest.cs new file mode 100644 index 0000000000..c0460ae66c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateStudentRequest.cs @@ -0,0 +1,132 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInUpdateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateStudentRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateStudentRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateStudentRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateStudentRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInUpdateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateStudentRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateStudentRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateTeacherRequest.cs new file mode 100644 index 0000000000..8d2379d3d7 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DataInUpdateTeacherRequest.cs @@ -0,0 +1,132 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataInUpdateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateTeacherRequest? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateTeacherRequest Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateTeacherRequest? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateTeacherRequest Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataInUpdateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AttributesInUpdateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteObjectValue("relationships", Relationships); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteCourseOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteCourseOperation.cs new file mode 100644 index 0000000000..db10962e6b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteCourseOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeleteCourseOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteCourseOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteCourseOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteEnrollmentOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteEnrollmentOperation.cs new file mode 100644 index 0000000000..9932949a9e --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteEnrollmentOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeleteEnrollmentOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteEnrollmentOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteEnrollmentOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteTeacherOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteTeacherOperation.cs new file mode 100644 index 0000000000..7c2f7b8ad8 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/DeleteTeacherOperation.cs @@ -0,0 +1,69 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DeleteTeacherOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteTeacherOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DeleteTeacherOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentAttributesInResponse.cs new file mode 100644 index 0000000000..9ba229ca02 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentAttributesInResponse.cs @@ -0,0 +1,76 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentAttributesInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrolledAt property + public Date? EnrolledAt + { + get { return BackingStore?.Get("enrolledAt"); } + set { BackingStore?.Set("enrolledAt", value); } + } + /// The graduatedAt property + public Date? GraduatedAt + { + get { return BackingStore?.Get("graduatedAt"); } + set { BackingStore?.Set("graduatedAt", value); } + } + /// The hasGraduated property + public bool? HasGraduated + { + get { return BackingStore?.Get("hasGraduated"); } + set { BackingStore?.Set("hasGraduated", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentAttributesInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentAttributesInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrolledAt", n => { EnrolledAt = n.GetDateValue(); } }, + { "graduatedAt", n => { GraduatedAt = n.GetDateValue(); } }, + { "hasGraduated", n => { HasGraduated = n.GetBoolValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteDateValue("enrolledAt", EnrolledAt); + writer.WriteDateValue("graduatedAt", GraduatedAt); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCollectionResponseDocument.cs new file mode 100644 index 0000000000..12bc2eba14 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCollectionResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipIdentifier.cs new file mode 100644 index 0000000000..893e1d372b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentCourseRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentCourseRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipName.cs new file mode 100644 index 0000000000..3698d1dc94 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentCourseRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum EnrollmentCourseRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "course")] + #pragma warning disable CS1591 + Course, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentDataInResponse.cs new file mode 100644 index 0000000000..e526194492 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentDataInResponse.cs @@ -0,0 +1,133 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentDataInResponse : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierCollectionResponseDocument.cs new file mode 100644 index 0000000000..cdc857c87d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierCollectionResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentIdentifierCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentIdentifierCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInRequest.cs new file mode 100644 index 0000000000..d3a630f2a2 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInResponse.cs new file mode 100644 index 0000000000..b29a79d920 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentPrimaryResponseDocument.cs new file mode 100644 index 0000000000..8489be8afd --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentPrimaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentPrimaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentPrimaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentPrimaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentRelationshipsInResponse.cs new file mode 100644 index 0000000000..39d0ca20e8 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentRelationshipsInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentRelationshipsInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The course property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInResponse? Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInResponse Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#endif + /// The student property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInResponse? Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInResponse Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentRelationshipsInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentRelationshipsInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "course", n => { Course = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInResponse.CreateFromDiscriminatorValue); } }, + { "student", n => { Student = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("course", Course); + writer.WriteObjectValue("student", Student); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentResourceType.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentResourceType.cs new file mode 100644 index 0000000000..160ea67a67 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentResourceType.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum EnrollmentResourceType + #pragma warning restore CS1591 + { + [EnumMember(Value = "enrollments")] + #pragma warning disable CS1591 + Enrollments, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipIdentifier.cs new file mode 100644 index 0000000000..b4419bfac6 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class EnrollmentStudentRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public EnrollmentStudentRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipName.cs new file mode 100644 index 0000000000..853be95ec4 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/EnrollmentStudentRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum EnrollmentStudentRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "student")] + #pragma warning disable CS1591 + Student, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorLinks.cs new file mode 100644 index 0000000000..6b6a311d04 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorLinks.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ErrorLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The about property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? About + { + get { return BackingStore?.Get("about"); } + set { BackingStore?.Set("about", value); } + } +#nullable restore +#else + public string About + { + get { return BackingStore?.Get("about"); } + set { BackingStore?.Set("about", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The type property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } +#nullable restore +#else + public string Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErrorLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "about", n => { About = n.GetStringValue(); } }, + { "type", n => { Type = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("about", About); + writer.WriteStringValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorObject.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorObject.cs new file mode 100644 index 0000000000..c22a2dd34f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorObject.cs @@ -0,0 +1,196 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ErrorObject : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The code property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Code + { + get { return BackingStore?.Get("code"); } + set { BackingStore?.Set("code", value); } + } +#nullable restore +#else + public string Code + { + get { return BackingStore?.Get("code"); } + set { BackingStore?.Set("code", value); } + } +#endif + /// The detail property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Detail + { + get { return BackingStore?.Get("detail"); } + set { BackingStore?.Set("detail", value); } + } +#nullable restore +#else + public string Detail + { + get { return BackingStore?.Get("detail"); } + set { BackingStore?.Set("detail", value); } + } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The source property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorSource? Source + { + get { return BackingStore?.Get("source"); } + set { BackingStore?.Set("source", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorSource Source + { + get { return BackingStore?.Get("source"); } + set { BackingStore?.Set("source", value); } + } +#endif + /// The status property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Status + { + get { return BackingStore?.Get("status"); } + set { BackingStore?.Set("status", value); } + } +#nullable restore +#else + public string Status + { + get { return BackingStore?.Get("status"); } + set { BackingStore?.Set("status", value); } + } +#endif + /// The title property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Title + { + get { return BackingStore?.Get("title"); } + set { BackingStore?.Set("title", value); } + } +#nullable restore +#else + public string Title + { + get { return BackingStore?.Get("title"); } + set { BackingStore?.Set("title", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErrorObject() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorObject CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorObject(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "code", n => { Code = n.GetStringValue(); } }, + { "detail", n => { Detail = n.GetStringValue(); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "source", n => { Source = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorSource.CreateFromDiscriminatorValue); } }, + { "status", n => { Status = n.GetStringValue(); } }, + { "title", n => { Title = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("code", Code); + writer.WriteStringValue("detail", Detail); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("source", Source); + writer.WriteStringValue("status", Status); + writer.WriteStringValue("title", Title); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorResponseDocument.cs new file mode 100644 index 0000000000..c5dc125d78 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorResponseDocument.cs @@ -0,0 +1,127 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ErrorResponseDocument : ApiException, IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The errors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Errors + { + get { return BackingStore?.Get?>("errors"); } + set { BackingStore?.Set("errors", value); } + } +#nullable restore +#else + public List Errors + { + get { return BackingStore?.Get>("errors"); } + set { BackingStore?.Set("errors", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The primary error message. + public override string Message { get => base.Message; } + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErrorResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "errors", n => { Errors = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorObject.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("errors", Errors); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorSource.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorSource.cs new file mode 100644 index 0000000000..37831401ca --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorSource.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ErrorSource : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The header property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Header + { + get { return BackingStore?.Get("header"); } + set { BackingStore?.Set("header", value); } + } +#nullable restore +#else + public string Header + { + get { return BackingStore?.Get("header"); } + set { BackingStore?.Set("header", value); } + } +#endif + /// The parameter property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Parameter + { + get { return BackingStore?.Get("parameter"); } + set { BackingStore?.Set("parameter", value); } + } +#nullable restore +#else + public string Parameter + { + get { return BackingStore?.Get("parameter"); } + set { BackingStore?.Set("parameter", value); } + } +#endif + /// The pointer property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Pointer + { + get { return BackingStore?.Get("pointer"); } + set { BackingStore?.Set("pointer", value); } + } +#nullable restore +#else + public string Pointer + { + get { return BackingStore?.Get("pointer"); } + set { BackingStore?.Set("pointer", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErrorSource() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorSource CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorSource(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "header", n => { Header = n.GetStringValue(); } }, + { "parameter", n => { Parameter = n.GetStringValue(); } }, + { "pointer", n => { Pointer = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("header", Header); + writer.WriteStringValue("parameter", Parameter); + writer.WriteStringValue("pointer", Pointer); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorTopLevelLinks.cs new file mode 100644 index 0000000000..32766aad89 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ErrorTopLevelLinks.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ErrorTopLevelLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The describedby property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#nullable restore +#else + public string Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ErrorTopLevelLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorTopLevelLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("describedby", Describedby); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Jsonapi.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Jsonapi.cs new file mode 100644 index 0000000000..969cab9366 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Jsonapi.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class Jsonapi : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The ext property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Ext + { + get { return BackingStore?.Get?>("ext"); } + set { BackingStore?.Set("ext", value); } + } +#nullable restore +#else + public List Ext + { + get { return BackingStore?.Get>("ext"); } + set { BackingStore?.Set("ext", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The profile property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Profile + { + get { return BackingStore?.Get?>("profile"); } + set { BackingStore?.Set("profile", value); } + } +#nullable restore +#else + public List Profile + { + get { return BackingStore?.Get>("profile"); } + set { BackingStore?.Set("profile", value); } + } +#endif + /// The version property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Version + { + get { return BackingStore?.Get("version"); } + set { BackingStore?.Set("version", value); } + } +#nullable restore +#else + public string Version + { + get { return BackingStore?.Get("version"); } + set { BackingStore?.Set("version", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public Jsonapi() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "ext", n => { Ext = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "profile", n => { Profile = n.GetCollectionOfPrimitiveValues()?.ToList(); } }, + { "version", n => { Version = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("ext", Ext); + writer.WriteObjectValue("meta", Meta); + writer.WriteCollectionOfPrimitiveValues("profile", Profile); + writer.WriteStringValue("version", Version); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Meta.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Meta.cs new file mode 100644 index 0000000000..3b61871d27 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/Meta.cs @@ -0,0 +1,60 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class Meta : IAdditionalDataHolder, IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData + { + get { return BackingStore.Get>("AdditionalData") ?? new Dictionary(); } + set { BackingStore.Set("AdditionalData", value); } + } + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// + /// Instantiates a new and sets the default values. + /// + public Meta() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteAdditionalData(AdditionalData); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherIdentifierResponseDocument.cs new file mode 100644 index 0000000000..9b705ac874 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherIdentifierResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NullableTeacherIdentifierResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NullableTeacherIdentifierResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherIdentifierResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherSecondaryResponseDocument.cs new file mode 100644 index 0000000000..94a3f57e56 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableTeacherSecondaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NullableTeacherSecondaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NullableTeacherSecondaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherSecondaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInRequest.cs new file mode 100644 index 0000000000..23848ff6d1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NullableToOneTeacherInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NullableToOneTeacherInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInResponse.cs new file mode 100644 index 0000000000..8599fe1542 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/NullableToOneTeacherInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NullableToOneTeacherInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public NullableToOneTeacherInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsRequestDocument.cs new file mode 100644 index 0000000000..7b9abdfa4d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsRequestDocument.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class OperationsRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The atomicOperations property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AtomicOperations + { + get { return BackingStore?.Get?>("atomic:operations"); } + set { BackingStore?.Set("atomic:operations", value); } + } +#nullable restore +#else + public List AtomicOperations + { + get { return BackingStore?.Get>("atomic:operations"); } + set { BackingStore?.Set("atomic:operations", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OperationsRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "atomic:operations", n => { AtomicOperations = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation.CreateFromDiscriminatorValue)?.ToList(); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("atomic:operations", AtomicOperations); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsResponseDocument.cs new file mode 100644 index 0000000000..efd793f879 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/OperationsResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class OperationsResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// The atomicResults property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? AtomicResults + { + get { return BackingStore?.Get?>("atomic:results"); } + set { BackingStore?.Set("atomic:results", value); } + } +#nullable restore +#else + public List AtomicResults + { + get { return BackingStore?.Get>("atomic:results"); } + set { BackingStore?.Set("atomic:results", value); } + } +#endif + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public OperationsResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "atomic:results", n => { AtomicResults = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicResult.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("atomic:results", AtomicResults); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipLinks.cs new file mode 100644 index 0000000000..dedf2f0343 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipLinks.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The related property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#nullable restore +#else + public string Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("related", Related); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateCourseRequest.cs new file mode 100644 index 0000000000..9e624e6e31 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateCourseRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInCreateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The taughtBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest? TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInCreateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest.CreateFromDiscriminatorValue); } }, + { "taughtBy", n => { TaughtBy = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("taughtBy", TaughtBy); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateEnrollmentRequest.cs new file mode 100644 index 0000000000..8554804d14 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateEnrollmentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInCreateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The course property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest? Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#endif + /// The student property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest? Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInCreateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "course", n => { Course = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest.CreateFromDiscriminatorValue); } }, + { "student", n => { Student = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("course", Course); + writer.WriteObjectValue("student", Student); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateStudentRequest.cs new file mode 100644 index 0000000000..736cda5798 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateStudentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInCreateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The mentor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest? Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInCreateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest.CreateFromDiscriminatorValue); } }, + { "mentor", n => { Mentor = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("mentor", Mentor); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateTeacherRequest.cs new file mode 100644 index 0000000000..26d17bc14c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInCreateTeacherRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInCreateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The mentors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest? Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#endif + /// The teaches property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest? Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInCreateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInCreateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mentors", n => { Mentors = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest.CreateFromDiscriminatorValue); } }, + { "teaches", n => { Teaches = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mentors", Mentors); + writer.WriteObjectValue("teaches", Teaches); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateCourseRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateCourseRequest.cs new file mode 100644 index 0000000000..0e10d7be13 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateCourseRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInUpdateCourseRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The taughtBy property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest? TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest TaughtBy + { + get { return BackingStore?.Get("taughtBy"); } + set { BackingStore?.Set("taughtBy", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInUpdateCourseRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateCourseRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateCourseRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest.CreateFromDiscriminatorValue); } }, + { "taughtBy", n => { TaughtBy = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("taughtBy", TaughtBy); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateEnrollmentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateEnrollmentRequest.cs new file mode 100644 index 0000000000..fdf7ff0bdb --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateEnrollmentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInUpdateEnrollmentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The course property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest? Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest Course + { + get { return BackingStore?.Get("course"); } + set { BackingStore?.Set("course", value); } + } +#endif + /// The student property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest? Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest Student + { + get { return BackingStore?.Get("student"); } + set { BackingStore?.Set("student", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInUpdateEnrollmentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateEnrollmentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateEnrollmentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "course", n => { Course = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest.CreateFromDiscriminatorValue); } }, + { "student", n => { Student = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("course", Course); + writer.WriteObjectValue("student", Student); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateStudentRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateStudentRequest.cs new file mode 100644 index 0000000000..26f1dfb930 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateStudentRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInUpdateStudentRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The mentor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest? Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInUpdateStudentRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateStudentRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateStudentRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest.CreateFromDiscriminatorValue); } }, + { "mentor", n => { Mentor = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("mentor", Mentor); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateTeacherRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateTeacherRequest.cs new file mode 100644 index 0000000000..4ed4dbdda6 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RelationshipsInUpdateTeacherRequest.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RelationshipsInUpdateTeacherRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The mentors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest? Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#endif + /// The teaches property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest? Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public RelationshipsInUpdateTeacherRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateTeacherRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipsInUpdateTeacherRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mentors", n => { Mentors = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest.CreateFromDiscriminatorValue); } }, + { "teaches", n => { Teaches = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mentors", Mentors); + writer.WriteObjectValue("teaches", Teaches); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromStudentEnrollmentsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromStudentEnrollmentsRelationshipOperation.cs new file mode 100644 index 0000000000..5dfb3945df --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromStudentEnrollmentsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromStudentEnrollmentsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromStudentEnrollmentsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromStudentEnrollmentsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherMentorsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherMentorsRelationshipOperation.cs new file mode 100644 index 0000000000..98612d9e1c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherMentorsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromTeacherMentorsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherMentorsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherMentorsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherTeachesRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherTeachesRelationshipOperation.cs new file mode 100644 index 0000000000..a184ec4512 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveFromTeacherTeachesRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class RemoveFromTeacherTeachesRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherTeachesRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RemoveFromTeacherTeachesRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveOperationCode.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveOperationCode.cs new file mode 100644 index 0000000000..dcad431ba0 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/RemoveOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum RemoveOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "remove")] + #pragma warning disable CS1591 + Remove, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs new file mode 100644 index 0000000000..d3825c79de --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceCollectionTopLevelLinks.cs @@ -0,0 +1,160 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ResourceCollectionTopLevelLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The describedby property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#nullable restore +#else + public string Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#endif + /// The first property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? First + { + get { return BackingStore?.Get("first"); } + set { BackingStore?.Set("first", value); } + } +#nullable restore +#else + public string First + { + get { return BackingStore?.Get("first"); } + set { BackingStore?.Set("first", value); } + } +#endif + /// The last property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Last + { + get { return BackingStore?.Get("last"); } + set { BackingStore?.Set("last", value); } + } +#nullable restore +#else + public string Last + { + get { return BackingStore?.Get("last"); } + set { BackingStore?.Set("last", value); } + } +#endif + /// The next property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Next + { + get { return BackingStore?.Get("next"); } + set { BackingStore?.Set("next", value); } + } +#nullable restore +#else + public string Next + { + get { return BackingStore?.Get("next"); } + set { BackingStore?.Set("next", value); } + } +#endif + /// The prev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prev + { + get { return BackingStore?.Get("prev"); } + set { BackingStore?.Set("prev", value); } + } +#nullable restore +#else + public string Prev + { + get { return BackingStore?.Get("prev"); } + set { BackingStore?.Set("prev", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourceCollectionTopLevelLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("describedby", Describedby); + writer.WriteStringValue("first", First); + writer.WriteStringValue("last", Last); + writer.WriteStringValue("next", Next); + writer.WriteStringValue("prev", Prev); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs new file mode 100644 index 0000000000..432167deff --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierCollectionTopLevelLinks.cs @@ -0,0 +1,178 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ResourceIdentifierCollectionTopLevelLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The describedby property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#nullable restore +#else + public string Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#endif + /// The first property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? First + { + get { return BackingStore?.Get("first"); } + set { BackingStore?.Set("first", value); } + } +#nullable restore +#else + public string First + { + get { return BackingStore?.Get("first"); } + set { BackingStore?.Set("first", value); } + } +#endif + /// The last property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Last + { + get { return BackingStore?.Get("last"); } + set { BackingStore?.Set("last", value); } + } +#nullable restore +#else + public string Last + { + get { return BackingStore?.Get("last"); } + set { BackingStore?.Set("last", value); } + } +#endif + /// The next property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Next + { + get { return BackingStore?.Get("next"); } + set { BackingStore?.Set("next", value); } + } +#nullable restore +#else + public string Next + { + get { return BackingStore?.Get("next"); } + set { BackingStore?.Set("next", value); } + } +#endif + /// The prev property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Prev + { + get { return BackingStore?.Get("prev"); } + set { BackingStore?.Set("prev", value); } + } +#nullable restore +#else + public string Prev + { + get { return BackingStore?.Get("prev"); } + set { BackingStore?.Set("prev", value); } + } +#endif + /// The related property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#nullable restore +#else + public string Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourceIdentifierCollectionTopLevelLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "first", n => { First = n.GetStringValue(); } }, + { "last", n => { Last = n.GetStringValue(); } }, + { "next", n => { Next = n.GetStringValue(); } }, + { "prev", n => { Prev = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("describedby", Describedby); + writer.WriteStringValue("first", First); + writer.WriteStringValue("last", Last); + writer.WriteStringValue("next", Next); + writer.WriteStringValue("prev", Prev); + writer.WriteStringValue("related", Related); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs new file mode 100644 index 0000000000..e4b4a4edab --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceIdentifierTopLevelLinks.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ResourceIdentifierTopLevelLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The describedby property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#nullable restore +#else + public string Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#endif + /// The related property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#nullable restore +#else + public string Related + { + get { return BackingStore?.Get("related"); } + set { BackingStore?.Set("related", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourceIdentifierTopLevelLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "related", n => { Related = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("describedby", Describedby); + writer.WriteStringValue("related", Related); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceLinks.cs new file mode 100644 index 0000000000..0394c7619c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceLinks.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ResourceLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourceLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceTopLevelLinks.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceTopLevelLinks.cs new file mode 100644 index 0000000000..e91f062eb2 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ResourceTopLevelLinks.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ResourceTopLevelLinks : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The describedby property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#nullable restore +#else + public string Describedby + { + get { return BackingStore?.Get("describedby"); } + set { BackingStore?.Set("describedby", value); } + } +#endif + /// The self property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#nullable restore +#else + public string Self + { + get { return BackingStore?.Get("self"); } + set { BackingStore?.Set("self", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ResourceTopLevelLinks() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "describedby", n => { Describedby = n.GetStringValue(); } }, + { "self", n => { Self = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("describedby", Describedby); + writer.WriteStringValue("self", Self); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentAttributesInResponse.cs new file mode 100644 index 0000000000..51846038f3 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentAttributesInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentAttributesInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentAttributesInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentAttributesInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentCollectionResponseDocument.cs new file mode 100644 index 0000000000..8c12bc9dbf --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentCollectionResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentDataInResponse.cs new file mode 100644 index 0000000000..3b7e9c7c91 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentDataInResponse.cs @@ -0,0 +1,133 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentDataInResponse : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipIdentifier.cs new file mode 100644 index 0000000000..9c30344292 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentEnrollmentsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public StudentEnrollmentsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipName.cs new file mode 100644 index 0000000000..57626bfd5a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentEnrollmentsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum StudentEnrollmentsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "enrollments")] + #pragma warning disable CS1591 + Enrollments, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierCollectionResponseDocument.cs new file mode 100644 index 0000000000..2180ebef5f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierCollectionResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentIdentifierCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentIdentifierCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInRequest.cs new file mode 100644 index 0000000000..bf3fa3546c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public StudentIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInResponse.cs new file mode 100644 index 0000000000..61bb8e38be --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public StudentIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierResponseDocument.cs new file mode 100644 index 0000000000..9d802b150d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentIdentifierResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentIdentifierResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentIdentifierResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipIdentifier.cs new file mode 100644 index 0000000000..0770b8e3af --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentMentorRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public StudentMentorRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipName.cs new file mode 100644 index 0000000000..bfe9ed4d55 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentMentorRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum StudentMentorRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "mentor")] + #pragma warning disable CS1591 + Mentor, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentPrimaryResponseDocument.cs new file mode 100644 index 0000000000..b48a77b39f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentPrimaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentPrimaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentPrimaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentPrimaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentRelationshipsInResponse.cs new file mode 100644 index 0000000000..a38c8e33b2 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentRelationshipsInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentRelationshipsInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The enrollments property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse? Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse Enrollments + { + get { return BackingStore?.Get("enrollments"); } + set { BackingStore?.Set("enrollments", value); } + } +#endif + /// The mentor property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInResponse? Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInResponse Mentor + { + get { return BackingStore?.Get("mentor"); } + set { BackingStore?.Set("mentor", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentRelationshipsInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentRelationshipsInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "enrollments", n => { Enrollments = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse.CreateFromDiscriminatorValue); } }, + { "mentor", n => { Mentor = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("enrollments", Enrollments); + writer.WriteObjectValue("mentor", Mentor); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentResourceType.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentResourceType.cs new file mode 100644 index 0000000000..f8eb0d030d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentResourceType.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum StudentResourceType + #pragma warning restore CS1591 + { + [EnumMember(Value = "students")] + #pragma warning disable CS1591 + Students, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentSecondaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentSecondaryResponseDocument.cs new file mode 100644 index 0000000000..dc0f7cb138 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/StudentSecondaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class StudentSecondaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public StudentSecondaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentSecondaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentSecondaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherAttributesInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherAttributesInResponse.cs new file mode 100644 index 0000000000..990227ddd3 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherAttributesInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherAttributesInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The emailAddress property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#nullable restore +#else + public string EmailAddress + { + get { return BackingStore?.Get("emailAddress"); } + set { BackingStore?.Set("emailAddress", value); } + } +#endif + /// The name property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#nullable restore +#else + public string Name + { + get { return BackingStore?.Get("name"); } + set { BackingStore?.Set("name", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TeacherAttributesInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherAttributesInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherAttributesInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "emailAddress", n => { EmailAddress = n.GetStringValue(); } }, + { "name", n => { Name = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("emailAddress", EmailAddress); + writer.WriteStringValue("name", Name); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherCollectionResponseDocument.cs new file mode 100644 index 0000000000..0e02e91b73 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherCollectionResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TeacherCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherDataInResponse.cs new file mode 100644 index 0000000000..e2fca8020f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherDataInResponse.cs @@ -0,0 +1,133 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherDataInResponse : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse, IParsable + #pragma warning restore CS1591 + { + /// The attributes property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherAttributesInResponse? Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherAttributesInResponse Attributes + { + get { return BackingStore?.Get("attributes"); } + set { BackingStore?.Set("attributes", value); } + } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// The relationships property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherRelationshipsInResponse? Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherRelationshipsInResponse Relationships + { + get { return BackingStore?.Get("relationships"); } + set { BackingStore?.Set("relationships", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherRelationshipsInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + writer.WriteObjectValue("relationships", Relationships); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierCollectionResponseDocument.cs new file mode 100644 index 0000000000..71d3a35555 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierCollectionResponseDocument.cs @@ -0,0 +1,124 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherIdentifierCollectionResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TeacherIdentifierCollectionResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierCollectionResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierCollectionResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInRequest.cs new file mode 100644 index 0000000000..82c3f84200 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInRequest.cs @@ -0,0 +1,96 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherIdentifierInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TeacherIdentifierInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInResponse.cs new file mode 100644 index 0000000000..5324d902a5 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TeacherIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipIdentifier.cs new file mode 100644 index 0000000000..f664684f7b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherMentorsRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TeacherMentorsRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipName.cs new file mode 100644 index 0000000000..f05bfa8aa1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherMentorsRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TeacherMentorsRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "mentors")] + #pragma warning disable CS1591 + Mentors, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherPrimaryResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherPrimaryResponseDocument.cs new file mode 100644 index 0000000000..ca8a7b08dc --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherPrimaryResponseDocument.cs @@ -0,0 +1,142 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherPrimaryResponseDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The included property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Included + { + get { return BackingStore?.Get?>("included"); } + set { BackingStore?.Set("included", value); } + } +#nullable restore +#else + public List Included + { + get { return BackingStore?.Get>("included"); } + set { BackingStore?.Set("included", value); } + } +#endif + /// The jsonapi property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi? Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi Jsonapi + { + get { return BackingStore?.Get("jsonapi"); } + set { BackingStore?.Set("jsonapi", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TeacherPrimaryResponseDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherPrimaryResponseDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherPrimaryResponseDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherDataInResponse.CreateFromDiscriminatorValue); } }, + { "included", n => { Included = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "jsonapi", n => { Jsonapi = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Jsonapi.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ResourceTopLevelLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteCollectionOfObjectValues("included", Included); + writer.WriteObjectValue("jsonapi", Jsonapi); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherRelationshipsInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherRelationshipsInResponse.cs new file mode 100644 index 0000000000..98d6ef8251 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherRelationshipsInResponse.cs @@ -0,0 +1,88 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherRelationshipsInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The mentors property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInResponse? Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInResponse Mentors + { + get { return BackingStore?.Get("mentors"); } + set { BackingStore?.Set("mentors", value); } + } +#endif + /// The teaches property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInResponse? Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInResponse Teaches + { + get { return BackingStore?.Get("teaches"); } + set { BackingStore?.Set("teaches", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public TeacherRelationshipsInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherRelationshipsInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherRelationshipsInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "mentors", n => { Mentors = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInResponse.CreateFromDiscriminatorValue); } }, + { "teaches", n => { Teaches = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInResponse.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("mentors", Mentors); + writer.WriteObjectValue("teaches", Teaches); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherResourceType.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherResourceType.cs new file mode 100644 index 0000000000..a0caa47881 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherResourceType.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TeacherResourceType + #pragma warning restore CS1591 + { + [EnumMember(Value = "teachers")] + #pragma warning disable CS1591 + Teachers, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipIdentifier.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipIdentifier.cs new file mode 100644 index 0000000000..0b68691918 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipIdentifier.cs @@ -0,0 +1,104 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TeacherTeachesRelationshipIdentifier : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The lid property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#nullable restore +#else + public string Lid + { + get { return BackingStore?.Get("lid"); } + set { BackingStore?.Set("lid", value); } + } +#endif + /// The relationship property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipName? Relationship + { + get { return BackingStore?.Get("relationship"); } + set { BackingStore?.Set("relationship", value); } + } + /// The type property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TeacherTeachesRelationshipIdentifier() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "lid", n => { Lid = n.GetStringValue(); } }, + { "relationship", n => { Relationship = n.GetEnumValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteStringValue("lid", Lid); + writer.WriteEnumValue("relationship", Relationship); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipName.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipName.cs new file mode 100644 index 0000000000..285731485f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/TeacherTeachesRelationshipName.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum TeacherTeachesRelationshipName + #pragma warning restore CS1591 + { + [EnumMember(Value = "teaches")] + #pragma warning disable CS1591 + Teaches, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInRequest.cs new file mode 100644 index 0000000000..e663a1cf0b --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyCourseInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyCourseInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInResponse.cs new file mode 100644 index 0000000000..49ff8ffff1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyCourseInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyCourseInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyCourseInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInRequest.cs new file mode 100644 index 0000000000..9a8ee0761f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyEnrollmentInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyEnrollmentInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInResponse.cs new file mode 100644 index 0000000000..605e1323d0 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyEnrollmentInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyEnrollmentInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyEnrollmentInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInRequest.cs new file mode 100644 index 0000000000..30400c049f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyStudentInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyStudentInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInResponse.cs new file mode 100644 index 0000000000..50b519bae1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyStudentInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyStudentInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyStudentInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInRequest.cs new file mode 100644 index 0000000000..7a72a12c52 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyTeacherInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyTeacherInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInResponse.cs new file mode 100644 index 0000000000..decd6f0c7c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToManyTeacherInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToManyTeacherInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToManyTeacherInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyTeacherInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInRequest.cs new file mode 100644 index 0000000000..6a58db3b19 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToOneCourseInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToOneCourseInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInResponse.cs new file mode 100644 index 0000000000..32a138246a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneCourseInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToOneCourseInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToOneCourseInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneCourseInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInRequest.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInRequest.cs new file mode 100644 index 0000000000..30f5774245 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInRequest.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToOneStudentInRequest : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToOneStudentInRequest() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInResponse.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInResponse.cs new file mode 100644 index 0000000000..df29bbfac6 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/ToOneStudentInResponse.cs @@ -0,0 +1,106 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ToOneStudentInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The links property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks? Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks Links + { + get { return BackingStore?.Get("links"); } + set { BackingStore?.Set("links", value); } + } +#endif + /// The meta property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta? Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta Meta + { + get { return BackingStore?.Get("meta"); } + set { BackingStore?.Set("meta", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public ToOneStudentInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToOneStudentInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInResponse.CreateFromDiscriminatorValue); } }, + { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, + { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("links", Links); + writer.WriteObjectValue("meta", Meta); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseEnrollmentsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseEnrollmentsRelationshipOperation.cs new file mode 100644 index 0000000000..ddbc0eda9d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseEnrollmentsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateCourseEnrollmentsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseEnrollmentsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseEnrollmentsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseEnrollmentsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseOperation.cs new file mode 100644 index 0000000000..71383b6a49 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateCourseOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseRequestDocument.cs new file mode 100644 index 0000000000..751d627e32 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateCourseRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateCourseRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateCourseRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateCourseRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateCourseRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentCourseRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentCourseRelationshipOperation.cs new file mode 100644 index 0000000000..2fad838073 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentCourseRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateEnrollmentCourseRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentCourseRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentCourseRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCourseRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentOperation.cs new file mode 100644 index 0000000000..c311061546 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateEnrollmentOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentRequestDocument.cs new file mode 100644 index 0000000000..843bd43283 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateEnrollmentRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateEnrollmentRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateEnrollmentRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentStudentRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentStudentRelationshipOperation.cs new file mode 100644 index 0000000000..add4a3241f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateEnrollmentStudentRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateEnrollmentStudentRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentStudentRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateEnrollmentStudentRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentStudentRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateOperationCode.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateOperationCode.cs new file mode 100644 index 0000000000..70f2124148 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateOperationCode.cs @@ -0,0 +1,15 @@ +// +using System.Runtime.Serialization; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public enum UpdateOperationCode + #pragma warning restore CS1591 + { + [EnumMember(Value = "update")] + #pragma warning disable CS1591 + Update, + #pragma warning restore CS1591 + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentEnrollmentsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentEnrollmentsRelationshipOperation.cs new file mode 100644 index 0000000000..3887e642db --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentEnrollmentsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateStudentEnrollmentsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentEnrollmentsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentEnrollmentsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentEnrollmentsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentMentorRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentMentorRelationshipOperation.cs new file mode 100644 index 0000000000..d0355c3c5d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentMentorRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateStudentMentorRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentMentorRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentMentorRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentMentorRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentOperation.cs new file mode 100644 index 0000000000..d990dece3f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateStudentOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentRequestDocument.cs new file mode 100644 index 0000000000..484f50d5f4 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateStudentRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateStudentRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateStudentRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateStudentRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherMentorsRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherMentorsRelationshipOperation.cs new file mode 100644 index 0000000000..82b469d7a3 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherMentorsRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTeacherMentorsRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherMentorsRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherMentorsRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherMentorsRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherOperation.cs new file mode 100644 index 0000000000..f12c7125b0 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTeacherOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest.CreateFromDiscriminatorValue); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherIdentifierInRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteObjectValue("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherRequestDocument.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherRequestDocument.cs new file mode 100644 index 0000000000..3d0110be98 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherRequestDocument.cs @@ -0,0 +1,70 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTeacherRequestDocument : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest? Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest Data + { + get { return BackingStore?.Get("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public UpdateTeacherRequestDocument() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.DataInUpdateTeacherRequest.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("data", Data); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherTeachesRelationshipOperation.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherTeachesRelationshipOperation.cs new file mode 100644 index 0000000000..cb91725291 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Models/UpdateTeacherTeachesRelationshipOperation.cs @@ -0,0 +1,87 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class UpdateTeacherTeachesRelationshipOperation : OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.AtomicOperation, IParsable + #pragma warning restore CS1591 + { + /// The data property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Data + { + get { return BackingStore?.Get?>("data"); } + set { BackingStore?.Set("data", value); } + } +#nullable restore +#else + public List Data + { + get { return BackingStore?.Get>("data"); } + set { BackingStore?.Set("data", value); } + } +#endif + /// The op property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateOperationCode? Op + { + get { return BackingStore?.Get("op"); } + set { BackingStore?.Set("op", value); } + } + /// The ref property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier? Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#nullable restore +#else + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier Ref + { + get { return BackingStore?.Get("ref"); } + set { BackingStore?.Set("ref", value); } + } +#endif + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherTeachesRelationshipOperation CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherTeachesRelationshipOperation(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public override IDictionary> GetFieldDeserializers() + { + return new Dictionary>(base.GetFieldDeserializers()) + { + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, + { "op", n => { Op = n.GetEnumValue(); } }, + { "ref", n => { Ref = n.GetObjectValue(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherTeachesRelationshipIdentifier.CreateFromDiscriminatorValue); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public override void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + base.Serialize(writer); + writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteEnumValue("op", Op); + writer.WriteObjectValue("ref", Ref); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs new file mode 100644 index 0000000000..854d7cb4f1 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Operations/OperationsRequestBuilder.cs @@ -0,0 +1,99 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations +{ + /// + /// Builds and executes requests for operations under \operations + /// + public class OperationsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public OperationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/operations", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public OperationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/operations", rawUrl) + { + } + /// + /// Performs multiple mutations in a linear and atomic manner. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Performs multiple mutations in a linear and atomic manner. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.OperationsRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json;ext=atomic-operations"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json;ext=atomic-operations", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations.OperationsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Operations.OperationsRequestBuilder(rawUrl, RequestAdapter); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Enrollments/EnrollmentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Enrollments/EnrollmentsRequestBuilder.cs new file mode 100644 index 0000000000..2ecd3c4631 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Enrollments/EnrollmentsRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments +{ + /// + /// Builds and executes requests for operations under \students\{id}\enrollments + /// + public class EnrollmentsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/enrollments{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/enrollments{?query*}", rawUrl) + { + } + /// + /// Retrieves the related enrollments of an individual student's enrollments relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related enrollments of an individual student's enrollments relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments.EnrollmentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments.EnrollmentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related enrollments of an individual student's enrollments relationship. + /// + public class EnrollmentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Mentor/MentorRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Mentor/MentorRequestBuilder.cs new file mode 100644 index 0000000000..26721298ac --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Mentor/MentorRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor +{ + /// + /// Builds and executes requests for operations under \students\{id}\mentor + /// + public class MentorRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MentorRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/mentor{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MentorRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/mentor{?query*}", rawUrl) + { + } + /// + /// Retrieves the related teacher of an individual student's mentor relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherSecondaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related teacher of an individual student's mentor relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor.MentorRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor.MentorRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related teacher of an individual student's mentor relationship. + /// + public class MentorRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class MentorRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs new file mode 100644 index 0000000000..a8163b2ff7 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Enrollments/EnrollmentsRequestBuilder.cs @@ -0,0 +1,305 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments +{ + /// + /// Builds and executes requests for operations under \students\{id}\relationships\enrollments + /// + public class EnrollmentsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships/enrollments{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public EnrollmentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships/enrollments{?query*}", rawUrl) + { + } + /// + /// Removes existing enrollments from the enrollments relationship of an individual student. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related enrollment identities of an individual student's enrollments relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.EnrollmentIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns existing enrollments to the enrollments relationship of an individual student. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds existing enrollments to the enrollments relationship of an individual student. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes existing enrollments from the enrollments relationship of an individual student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Retrieves the related enrollment identities of an individual student's enrollments relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns existing enrollments to the enrollments relationship of an individual student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Adds existing enrollments to the enrollments relationship of an individual student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyEnrollmentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments.EnrollmentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments.EnrollmentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related enrollment identities of an individual student's enrollments relationship. + /// + public class EnrollmentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class EnrollmentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Mentor/MentorRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Mentor/MentorRequestBuilder.cs new file mode 100644 index 0000000000..6290049027 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/Mentor/MentorRequestBuilder.cs @@ -0,0 +1,205 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor +{ + /// + /// Builds and executes requests for operations under \students\{id}\relationships\mentor + /// + public class MentorRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MentorRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships/mentor{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MentorRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships/mentor{?query*}", rawUrl) + { + } + /// + /// Retrieves the related teacher identity of an individual student's mentor relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableTeacherIdentifierResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Clears or assigns an existing teacher to the mentor relationship of an individual student. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related teacher identity of an individual student's mentor relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Clears or assigns an existing teacher to the mentor relationship of an individual student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.NullableToOneTeacherInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor.MentorRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor.MentorRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related teacher identity of an individual student's mentor relationship. + /// + public class MentorRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class MentorRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/RelationshipsRequestBuilder.cs new file mode 100644 index 0000000000..f70801f6dd --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/Relationships/RelationshipsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships +{ + /// + /// Builds and executes requests for operations under \students\{id}\relationships + /// + public class RelationshipsRequestBuilder : BaseRequestBuilder + { + /// The enrollments property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments.EnrollmentsRequestBuilder Enrollments + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Enrollments.EnrollmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The mentor property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor.MentorRequestBuilder Mentor + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.Mentor.MentorRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}/relationships", rawUrl) + { + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/StudentsItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/StudentsItemRequestBuilder.cs new file mode 100644 index 0000000000..7234e3760a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/Item/StudentsItemRequestBuilder.cs @@ -0,0 +1,242 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item +{ + /// + /// Builds and executes requests for operations under \students\{id} + /// + public class StudentsItemRequestBuilder : BaseRequestBuilder + { + /// The enrollments property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments.EnrollmentsRequestBuilder Enrollments + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Enrollments.EnrollmentsRequestBuilder(PathParameters, RequestAdapter); + } + /// The mentor property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor.MentorRequestBuilder Mentor + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Mentor.MentorRequestBuilder(PathParameters, RequestAdapter); + } + /// The relationships property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.RelationshipsRequestBuilder Relationships + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StudentsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StudentsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students/{id}{?query*}", rawUrl) + { + } + /// + /// Retrieves an individual student by its identifier. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an existing student. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an individual student by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Updates an existing student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateStudentRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.StudentsItemRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.StudentsItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves an individual student by its identifier. + /// + public class StudentsItemRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class StudentsItemRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Updates an existing student. + /// + public class StudentsItemRequestBuilderPatchQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/StudentsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/StudentsRequestBuilder.cs new file mode 100644 index 0000000000..3235bbf269 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Students/StudentsRequestBuilder.cs @@ -0,0 +1,237 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students +{ + /// + /// Builds and executes requests for operations under \students + /// + public class StudentsRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.students.item collection + /// The identifier of the student to retrieve. + /// A + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.StudentsItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.Item.StudentsItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public StudentsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public StudentsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/students{?query*}", rawUrl) + { + } + /// + /// Retrieves a collection of students. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new student. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a collection of students. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Creates a new student. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateStudentRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.StudentsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Students.StudentsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves a collection of students. + /// + public class StudentsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class StudentsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Creates a new student. + /// + public class StudentsRequestBuilderPostQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Mentors/MentorsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Mentors/MentorsRequestBuilder.cs new file mode 100644 index 0000000000..f01b450690 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Mentors/MentorsRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors +{ + /// + /// Builds and executes requests for operations under \teachers\{id}\mentors + /// + public class MentorsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MentorsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/mentors{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MentorsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/mentors{?query*}", rawUrl) + { + } + /// + /// Retrieves the related students of an individual teacher's mentors relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related students of an individual teacher's mentors relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors.MentorsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors.MentorsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related students of an individual teacher's mentors relationship. + /// + public class MentorsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class MentorsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Mentors/MentorsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Mentors/MentorsRequestBuilder.cs new file mode 100644 index 0000000000..84b4758e1f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Mentors/MentorsRequestBuilder.cs @@ -0,0 +1,305 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors +{ + /// + /// Builds and executes requests for operations under \teachers\{id}\relationships\mentors + /// + public class MentorsRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public MentorsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships/mentors{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public MentorsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships/mentors{?query*}", rawUrl) + { + } + /// + /// Removes existing students from the mentors relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related student identities of an individual teacher's mentors relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.StudentIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns existing students to the mentors relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds existing students to the mentors relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes existing students from the mentors relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Retrieves the related student identities of an individual teacher's mentors relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns existing students to the mentors relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Adds existing students to the mentors relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyStudentInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors.MentorsRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors.MentorsRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related student identities of an individual teacher's mentors relationship. + /// + public class MentorsRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class MentorsRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/RelationshipsRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/RelationshipsRequestBuilder.cs new file mode 100644 index 0000000000..b54a3a40d4 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/RelationshipsRequestBuilder.cs @@ -0,0 +1,44 @@ +// +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships +{ + /// + /// Builds and executes requests for operations under \teachers\{id}\relationships + /// + public class RelationshipsRequestBuilder : BaseRequestBuilder + { + /// The mentors property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors.MentorsRequestBuilder Mentors + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Mentors.MentorsRequestBuilder(PathParameters, RequestAdapter); + } + /// The teaches property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches.TeachesRequestBuilder Teaches + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches.TeachesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public RelationshipsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships", rawUrl) + { + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Teaches/TeachesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Teaches/TeachesRequestBuilder.cs new file mode 100644 index 0000000000..4fd2d81bff --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Relationships/Teaches/TeachesRequestBuilder.cs @@ -0,0 +1,305 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches +{ + /// + /// Builds and executes requests for operations under \teachers\{id}\relationships\teaches + /// + public class TeachesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeachesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships/teaches{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeachesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/relationships/teaches{?query*}", rawUrl) + { + } + /// + /// Removes existing courses from the teaches relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToDeleteRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related course identities of an individual teacher's teaches relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseIdentifierCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Assigns existing courses to the teaches relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Adds existing courses to the teaches relationship of an individual teacher. + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Removes existing courses from the teaches relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Retrieves the related course identities of an individual teacher's teaches relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Assigns existing courses to the teaches relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Adds existing courses to the teaches relationship of an individual teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ToManyCourseInRequest body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches.TeachesRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.Teaches.TeachesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related course identities of an individual teacher's teaches relationship. + /// + public class TeachesRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TeachesRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/TeachersItemRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/TeachersItemRequestBuilder.cs new file mode 100644 index 0000000000..a43ffd0605 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/TeachersItemRequestBuilder.cs @@ -0,0 +1,283 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item +{ + /// + /// Builds and executes requests for operations under \teachers\{id} + /// + public class TeachersItemRequestBuilder : BaseRequestBuilder + { + /// The mentors property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors.MentorsRequestBuilder Mentors + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Mentors.MentorsRequestBuilder(PathParameters, RequestAdapter); + } + /// The relationships property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.RelationshipsRequestBuilder Relationships + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Relationships.RelationshipsRequestBuilder(PathParameters, RequestAdapter); + } + /// The teaches property + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches.TeachesRequestBuilder Teaches + { + get => new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches.TeachesRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeachersItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeachersItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}{?query*}", rawUrl) + { + } + /// + /// Deletes an existing teacher by its identifier. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToDeleteRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves an individual teacher by its identifier. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Updates an existing teacher. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PatchAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPatchRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an existing teacher by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Retrieves an individual teacher by its identifier. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Updates an existing teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPatchRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.UpdateTeacherRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.TeachersItemRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.TeachersItemRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves an individual teacher by its identifier. + /// + public class TeachersItemRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TeachersItemRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Updates an existing teacher. + /// + public class TeachersItemRequestBuilderPatchQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Teaches/TeachesRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Teaches/TeachesRequestBuilder.cs new file mode 100644 index 0000000000..c28573dbfe --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/Item/Teaches/TeachesRequestBuilder.cs @@ -0,0 +1,155 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches +{ + /// + /// Builds and executes requests for operations under \teachers\{id}\teaches + /// + public class TeachesRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeachesRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/teaches{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeachesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers/{id}/teaches{?query*}", rawUrl) + { + } + /// + /// Retrieves the related courses of an individual teacher's teaches relationship. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 404 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CourseCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves the related courses of an individual teacher's teaches relationship. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches.TeachesRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.Teaches.TeachesRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves the related courses of an individual teacher's teaches relationship. + /// + public class TeachesRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TeachesRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/TeachersRequestBuilder.cs b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/TeachersRequestBuilder.cs new file mode 100644 index 0000000000..1840169515 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/AtomicOperations/GeneratedCode/Teachers/TeachersRequestBuilder.cs @@ -0,0 +1,237 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models; +using OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers +{ + /// + /// Builds and executes requests for operations under \teachers + /// + public class TeachersRequestBuilder : BaseRequestBuilder + { + /// Gets an item from the OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.teachers.item collection + /// The identifier of the teacher to retrieve. + /// A + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.TeachersItemRequestBuilder this[string position] + { + get + { + var urlTplParams = new Dictionary(PathParameters); + urlTplParams.Add("id", position); + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.Item.TeachersItemRequestBuilder(urlTplParams, RequestAdapter); + } + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TeachersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers{?query*}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TeachersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/teachers{?query*}", rawUrl) + { + } + /// + /// Retrieves a collection of teachers. + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherCollectionResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task HeadAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task HeadAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToHeadRequestInformation(requestConfiguration); + await RequestAdapter.SendNoContentAsync(requestInfo, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Creates a new teacher. + /// + /// A + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 400 status code + /// When receiving a 403 status code + /// When receiving a 404 status code + /// When receiving a 409 status code + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "400", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "403", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "404", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "409", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + { "422", OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.ErrorResponseDocument.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.TeacherPrimaryResponseDocument.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves a collection of teachers. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + return requestInfo; + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToHeadRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToHeadRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.HEAD, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + return requestInfo; + } + /// + /// Creates a new teacher. + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Models.CreateTeacherRequestDocument body, Action> requestConfiguration = default) + { +#endif + _ = body ?? throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/vnd.api+json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/vnd.api+json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.TeachersRequestBuilder WithUrl(string rawUrl) + { + return new OpenApiKiotaEndToEndTests.AtomicOperations.GeneratedCode.Teachers.TeachersRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Retrieves a collection of teachers. + /// + public class TeachersRequestBuilderGetQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched. + /// + public class TeachersRequestBuilderHeadQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + /// + /// Creates a new teacher. + /// + public class TeachersRequestBuilderPostQueryParameters + { + /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("query")] + public string? Query { get; set; } +#nullable restore +#else + [QueryParameter("query")] + public string Query { get; set; } +#endif + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs index 16f4f3e087..0fa2169b0d 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -77,7 +61,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -88,7 +71,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs index f4e55bdd54..9fe2c5262f 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Ga get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInRequest.cs similarity index 87% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInRequest.cs index 0475531b0a..ebb89c9365 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class GameIdentifier : IBackedModel, IParsable + public class GameIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Ga set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public GameIdentifier() + public GameIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInResponse.cs new file mode 100644 index 0000000000..c754be5a2a --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/GameIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class GameIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public GameIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs index 4995a8cc88..0fb8997043 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Pl get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs index 12afdf702f..bce1655948 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Pl get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInRequest.cs index 717ee59e79..ede6e468c5 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerGroupIdentifier : IBackedModel, IParsable + public class PlayerGroupIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Pl set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerGroupIdentifier() + public PlayerGroupIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInResponse.cs new file mode 100644 index 0000000000..e367e60830 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerGroupIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class PlayerGroupIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public PlayerGroupIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInRequest.cs similarity index 89% rename from test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInRequest.cs index bd3db3e273..e5665da1aa 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models { #pragma warning disable CS1591 - public class PlayerIdentifier : IBackedModel, IParsable + public class PlayerIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Pl set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public PlayerIdentifier() + public PlayerIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier(); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInResponse.cs new file mode 100644 index 0000000000..de1bb95d84 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/PlayerIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class PlayerIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public PlayerIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs index 88fdf6163b..32fa6fa4ce 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInRequest.cs @@ -16,16 +16,16 @@ public class ToManyGameInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs index b682872637..525b0de8a1 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyGameInResponse.cs @@ -16,16 +16,16 @@ public class ToManyGameInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.GameIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs index 04c22d1fa5..fb4335cd77 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInRequest.cs @@ -16,16 +16,16 @@ public class ToManyPlayerGroupInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs index fe9c8e5d7f..c12128eb74 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerGroupInResponse.cs @@ -16,16 +16,16 @@ public class ToManyPlayerGroupInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerGroupIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs index 044f670f25..c43eab0058 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInRequest.cs @@ -16,16 +16,16 @@ public class ToManyPlayerInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs index 9e49454b3a..24ef614608 100644 --- a/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ClientIdGenerationModes/GeneratedCode/Models/ToManyPlayerInResponse.cs @@ -16,16 +16,16 @@ public class ToManyPlayerInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.PlayerIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ClientIdGenerationModes.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs index cb5b20c334..a56b9fcd0b 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/CountryDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesI get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.CountryRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs index f487354f7d..6c2bf407c2 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -76,7 +60,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -87,7 +70,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs index a2488a88f1..db789a5642 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributes get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs index 1459e9779f..607a9e32d6 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class LanguageIdentifierCollectionResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInRequest.cs index 62d4a68bdb..2e1835703f 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models { #pragma warning disable CS1591 - public class LanguageIdentifier : IBackedModel, IParsable + public class LanguageIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageResourceTy set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public LanguageIdentifier() + public LanguageIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier(); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInResponse.cs new file mode 100644 index 0000000000..ca07163c9e --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/LanguageIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class LanguageIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public LanguageIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs index 7ad72387d7..4ac48167b2 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInRequest.cs @@ -16,16 +16,16 @@ public class ToManyLanguageInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs index 908f2fb61e..33acb2f306 100644 --- a/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Headers/GeneratedCode/Models/ToManyLanguageInResponse.cs @@ -16,16 +16,16 @@ public class ToManyLanguageInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.LanguageIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Headers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs index dd3b6878de..7e7be5931b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttribu get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInRequest.cs index 4bd114bc48..74e526d172 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class AccommodationIdentifier : IBackedModel, IParsable + public class AccommodationIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationResourc set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public AccommodationIdentifier() + public AccommodationIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInResponse.cs new file mode 100644 index 0000000000..c5e144af5f --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class AccommodationIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public AccommodationIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs index 9840501645..204a05da0a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/AccommodationIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class AccommodationIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs index 21930562a4..529e8eaf82 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -78,7 +62,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -89,7 +72,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs index 18a0381b14..3e94b6b2d1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesI get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs index 1d85d75531..2e34b1fa0a 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class ExcursionIdentifierCollectionResponseDocument : IBackedModel, IPars /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInRequest.cs index 62cfd7843b..fc80f06214 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class ExcursionIdentifier : IBackedModel, IParsable + public class ExcursionIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionResourceTyp set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public ExcursionIdentifier() + public ExcursionIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInResponse.cs new file mode 100644 index 0000000000..dfe2df2c54 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ExcursionIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class ExcursionIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public ExcursionIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs index 704015e162..fa19cf40ec 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInRequest.cs @@ -16,16 +16,16 @@ public class NullableToOneTransportInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs index 0f0fa0b060..7137de2ae1 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableToOneTransportInResponse.cs @@ -16,16 +16,16 @@ public class NullableToOneTransportInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs index 2b28d31b97..4368807471 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/NullableTransportIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class NullableTransportIdentifierResponseDocument : IBackedModel, IParsab /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs index 47f434e06d..a933db5bf7 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInRequest.cs @@ -16,16 +16,16 @@ public class ToManyExcursionInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs index 925f99970c..0e8fd7d543 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToManyExcursionInResponse.cs @@ -16,16 +16,16 @@ public class ToManyExcursionInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ExcursionIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs index 8323ed8d0e..5a7a348647 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInRequest.cs @@ -16,16 +16,16 @@ public class ToOneAccommodationInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs index 09f8f98a2b..4e2f51610b 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/ToOneAccommodationInResponse.cs @@ -16,16 +16,16 @@ public class ToOneAccommodationInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier? Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier Data + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.AccommodationIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs index d5aece93a4..5f49bfbeb6 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesI get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInRequest.cs index 35af6e5a60..96dd0b3c6f 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models { #pragma warning disable CS1591 - public class TransportIdentifier : IBackedModel, IParsable + public class TransportIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportResourceTyp set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public TransportIdentifier() + public TransportIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifier(); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInResponse.cs new file mode 100644 index 0000000000..6e3fa7728c --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/TransportIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class TransportIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public TransportIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.TransportIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs index 1d0613fce7..e6fdceba14 100644 --- a/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/Links/GeneratedCode/Models/VacationDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesIn get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.Links.GeneratedCode.Models.VacationRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs index dbd6d3a4e3..18f8b522bd 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -75,7 +59,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -86,7 +69,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs index 2bd3f3aed3..088304bae2 100644 --- a/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/ModelStateValidation/GeneratedCode/Models/SocialMediaAccountDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Socia get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.SocialMediaAccountAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.ModelStateValidation.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/OpenApiKiotaEndToEndTests.csproj b/test/OpenApiKiotaEndToEndTests/OpenApiKiotaEndToEndTests.csproj index abb1cd95ce..35cf974a31 100644 --- a/test/OpenApiKiotaEndToEndTests/OpenApiKiotaEndToEndTests.csproj +++ b/test/OpenApiKiotaEndToEndTests/OpenApiKiotaEndToEndTests.csproj @@ -38,6 +38,8 @@ Command="dotnet kiota generate --language CSharp --class-name RestrictedControllersClient --namespace-name OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode --output ./RestrictedControllers/GeneratedCode --backing-store --exclude-backward-compatible --clean-output --clear-cache --log-level Error --openapi ../OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json" /> + diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs index 86201f381a..c1958e4487 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -76,7 +60,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -87,7 +70,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs index 9be00d2c52..96b966a611 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePair get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs index 35906005fa..d1fdfdb285 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class NameValuePairIdentifierCollectionResponseDocument : IBackedModel, I /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInRequest.cs similarity index 87% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInRequest.cs index ccea4c0bad..f75387b512 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NameValuePairIdentifier : IBackedModel, IParsable + public class NameValuePairIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePair set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NameValuePairIdentifier() + public NameValuePairIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInResponse.cs new file mode 100644 index 0000000000..33ebae8a3d --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NameValuePairIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NameValuePairIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public NameValuePairIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs index 2e97a43736..2024918a6b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttribute get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs index 08e09d31b1..4a4f6dfbcc 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class NodeIdentifierCollectionResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInRequest.cs index 0c865eca81..e4f343d12b 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models { #pragma warning disable CS1591 - public class NodeIdentifier : IBackedModel, IParsable + public class NodeIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeResourceT set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public NodeIdentifier() + public NodeIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier(); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInResponse.cs new file mode 100644 index 0000000000..a7099f0ff6 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class NodeIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public NodeIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs index aca6d06d77..7a7fb28df9 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NodeIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class NodeIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs index b8d8cacd3f..d7f22a2623 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableNodeIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class NullableNodeIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs index a7a9ab7ac2..dfc4c4004f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInRequest.cs @@ -16,16 +16,16 @@ public class NullableToOneNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs index de26b64319..ccea9fa392 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/NullableToOneNodeInResponse.cs @@ -16,16 +16,16 @@ public class NullableToOneNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs index ed04da086e..6e00f3073f 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInRequest.cs @@ -16,16 +16,16 @@ public class ToManyNameValuePairInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs index e1191fc2b5..8ffca2a60a 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNameValuePairInResponse.cs @@ -16,16 +16,16 @@ public class ToManyNameValuePairInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NameValuePairIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs index 3588d956ec..a9a8eacf96 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInRequest.cs @@ -16,16 +16,16 @@ public class ToManyNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs index 97042ed6a4..e9e8e1b8be 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToManyNodeInResponse.cs @@ -16,16 +16,16 @@ public class ToManyNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs index 3ded9739fc..d147b9fba9 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInRequest.cs @@ -16,16 +16,16 @@ public class ToOneNodeInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs index 68171ebdb0..60a949336c 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/GeneratedCode/Models/ToOneNodeInResponse.cs @@ -16,16 +16,16 @@ public class ToOneNodeInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier? Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier Data + public OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.NodeIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.QueryStrings.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/QueryStrings/IncludeTests.cs b/test/OpenApiKiotaEndToEndTests/QueryStrings/IncludeTests.cs index 0c7c769b8b..ba5dcf6e39 100644 --- a/test/OpenApiKiotaEndToEndTests/QueryStrings/IncludeTests.cs +++ b/test/OpenApiKiotaEndToEndTests/QueryStrings/IncludeTests.cs @@ -58,8 +58,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.ElementAt(0).Id.Should().Be(node.StringId); response.Included.ShouldHaveCount(2); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values.ElementAt(0).StringId); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values.ElementAt(1).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values.ElementAt(0).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values.ElementAt(1).StringId); } } @@ -97,9 +101,15 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.Id.Should().Be(node.StringId); response.Included.ShouldHaveCount(3); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Children.ElementAt(0).StringId); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Children.ElementAt(1).StringId); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values[0].StringId); + + response.Included.Should().ContainSingle(include => + include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Children.ElementAt(0).StringId); + + response.Included.Should().ContainSingle(include => + include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Children.ElementAt(1).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values[0].StringId); } } @@ -136,8 +146,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.ShouldHaveCount(2); response.Included.ShouldHaveCount(2); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.StringId); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Parent.StringId); + response.Included.Should().ContainSingle(include => include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.StringId); + response.Included.Should().ContainSingle(include => include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Parent.StringId); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs index ae4eb391fb..3a71cac30d 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/CreateResourceTests.cs @@ -58,7 +58,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingVideoStream.StringId! @@ -68,7 +68,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingAudioStream.StringId! @@ -186,7 +186,7 @@ public async Task Cannot_create_resource_with_unknown_relationship_ID() { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = unknownVideoStreamId diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs index 88dc4088f9..c9290a80e7 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataInResponse.cs @@ -13,22 +13,6 @@ public class DataInResponse : IBackedModel, IParsable { /// Stores model information. public IBackingStore BackingStore { get; private set; } - /// The id property -#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER -#nullable enable - public string? Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#nullable restore -#else - public string Id - { - get { return BackingStore?.Get("id"); } - set { BackingStore?.Set("id", value); } - } -#endif /// The type property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -78,7 +62,6 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "id", n => { Id = n.GetStringValue(); } }, { "type", n => { Type = n.GetStringValue(); } }, }; } @@ -89,7 +72,6 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteStringValue("id", Id); writer.WriteStringValue("type", Type); } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs index 6358a6b2f4..b47beb8100 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Data get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -77,6 +93,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -90,6 +107,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs index b700785c3b..d048943740 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierCollectionResponseDocument.cs @@ -16,16 +16,16 @@ public class DataStreamIdentifierCollectionResponseDocument : IBackedModel, IPar /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierCollectionTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInRequest.cs similarity index 88% rename from test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs rename to test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInRequest.cs index e5815d100f..5bf5f0e639 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifier.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInRequest.cs @@ -8,7 +8,7 @@ namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models { #pragma warning disable CS1591 - public class DataStreamIdentifier : IBackedModel, IParsable + public class DataStreamIdentifierInRequest : IBackedModel, IParsable #pragma warning restore CS1591 { /// Stores model information. @@ -36,21 +36,21 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Data set { BackingStore?.Set("type", value); } } /// - /// Instantiates a new and sets the default values. + /// Instantiates a new and sets the default values. /// - public DataStreamIdentifier() + public DataStreamIdentifierInRequest() { BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); } /// /// Creates a new instance of the appropriate class based on discriminator value /// - /// A + /// A /// The parse node to use to read the discriminator value and create the object - public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier CreateFromDiscriminatorValue(IParseNode parseNode) + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest CreateFromDiscriminatorValue(IParseNode parseNode) { _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); - return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier(); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest(); } /// /// The deserialization information for the current model diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInResponse.cs new file mode 100644 index 0000000000..cef0324348 --- /dev/null +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierInResponse.cs @@ -0,0 +1,78 @@ +// +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions.Store; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System; +namespace OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models +{ + #pragma warning disable CS1591 + public class DataStreamIdentifierInResponse : IBackedModel, IParsable + #pragma warning restore CS1591 + { + /// Stores model information. + public IBackingStore BackingStore { get; private set; } + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#endif + /// The type property + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamResourceType? Type + { + get { return BackingStore?.Get("type"); } + set { BackingStore?.Set("type", value); } + } + /// + /// Instantiates a new and sets the default values. + /// + public DataStreamIdentifierInResponse() + { + BackingStore = BackingStoreFactorySingleton.Instance.CreateBackingStore(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + _ = parseNode ?? throw new ArgumentNullException(nameof(parseNode)); + return new OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "id", n => { Id = n.GetStringValue(); } }, + { "type", n => { Type = n.GetEnumValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + _ = writer ?? throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("id", Id); + writer.WriteEnumValue("type", Type); + } + } +} diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs index 7be52e4bad..87675c72b3 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/DataStreamIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class DataStreamIdentifierResponseDocument : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs index a5cd66df48..648625b896 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableDataStreamIdentifierResponseDocument.cs @@ -16,16 +16,16 @@ public class NullableDataStreamIdentifierResponseDocument : IBackedModel, IParsa /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceIdentifierTopLevelLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs index a166580cf6..f311a7c0f0 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInRequest.cs @@ -16,16 +16,16 @@ public class NullableToOneDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs index 4bb53e72aa..14cade3b43 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/NullableToOneDataStreamInResponse.cs @@ -16,16 +16,16 @@ public class NullableToOneDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs index ec2e972949..7e5fe6fb9c 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyChannelDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Read get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs index b08ac619b5..8b5c5f59b1 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ReadOnlyResourceChannelDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Read get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ReadOnlyResourceChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs index 4b01a045a4..314945f8e2 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInRequest.cs @@ -16,16 +16,16 @@ public class ToManyDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest.CreateFromDiscriminatorValue)?.ToList(); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs index 9fd0406862..ba4cf6d675 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToManyDataStreamInResponse.cs @@ -16,16 +16,16 @@ public class ToManyDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public List? Data + public List? Data { - get { return BackingStore?.Get?>("data"); } + get { return BackingStore?.Get?>("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public List Data + public List Data { - get { return BackingStore?.Get>("data"); } + get { return BackingStore?.Get>("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue)?.ToList(); } }, + { "data", n => { Data = n.GetCollectionOfObjectValues(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue)?.ToList(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteCollectionOfObjectValues("data", Data); + writer.WriteCollectionOfObjectValues("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs index 165fd9950a..9e38d2d128 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInRequest.cs @@ -16,16 +16,16 @@ public class ToOneDataStreamInRequest : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -54,7 +54,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInRequest.CreateFromDiscriminatorValue); } }, }; } /// @@ -64,7 +64,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); } } } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs index 995ac298de..2a6a342638 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/ToOneDataStreamInResponse.cs @@ -16,16 +16,16 @@ public class ToOneDataStreamInResponse : IBackedModel, IParsable /// The data property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier? Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse? Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #nullable restore #else - public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier Data + public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse Data { - get { return BackingStore?.Get("data"); } + get { return BackingStore?.Get("data"); } set { BackingStore?.Set("data", value); } } #endif @@ -86,7 +86,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { - { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifier.CreateFromDiscriminatorValue); } }, + { "data", n => { Data = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.DataStreamIdentifierInResponse.CreateFromDiscriminatorValue); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.RelationshipLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, }; @@ -98,7 +98,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { _ = writer ?? throw new ArgumentNullException(nameof(writer)); - writer.WriteObjectValue("data", Data); + writer.WriteObjectValue("data", Data); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); } diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs index 22c0f919c8..c3e2211745 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/GeneratedCode/Models/WriteOnlyChannelDataInResponse.cs @@ -25,6 +25,22 @@ public OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Writ get { return BackingStore?.Get("attributes"); } set { BackingStore?.Set("attributes", value); } } +#endif + /// The id property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } +#nullable restore +#else + public string Id + { + get { return BackingStore?.Get("id"); } + set { BackingStore?.Set("id", value); } + } #endif /// The links property #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER @@ -93,6 +109,7 @@ public override IDictionary> GetFieldDeserializers() return new Dictionary>(base.GetFieldDeserializers()) { { "attributes", n => { Attributes = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelAttributesInResponse.CreateFromDiscriminatorValue); } }, + { "id", n => { Id = n.GetStringValue(); } }, { "links", n => { Links = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.ResourceLinks.CreateFromDiscriminatorValue); } }, { "meta", n => { Meta = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.Meta.CreateFromDiscriminatorValue); } }, { "relationships", n => { Relationships = n.GetObjectValue(OpenApiKiotaEndToEndTests.RestrictedControllers.GeneratedCode.Models.WriteOnlyChannelRelationshipsInResponse.CreateFromDiscriminatorValue); } }, @@ -107,6 +124,7 @@ public override void Serialize(ISerializationWriter writer) _ = writer ?? throw new ArgumentNullException(nameof(writer)); base.Serialize(writer); writer.WriteObjectValue("attributes", Attributes); + writer.WriteStringValue("id", Id); writer.WriteObjectValue("links", Links); writer.WriteObjectValue("meta", Meta); writer.WriteObjectValue("relationships", Relationships); diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs index b2606ca26d..61b6675820 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs @@ -49,7 +49,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => var requestBody = new NullableToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingVideoStream.StringId! @@ -141,7 +141,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingAudioStream.StringId! @@ -234,7 +234,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingAudioStream.StringId! @@ -284,12 +284,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingChannel.AudioStreams.ElementAt(0).StringId! }, - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingChannel.AudioStreams.ElementAt(1).StringId! @@ -366,12 +366,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = unknownAudioStreamId1 }, - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = unknownAudioStreamId2 diff --git a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs index c627d8525e..e6ee4212ee 100644 --- a/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs +++ b/test/OpenApiKiotaEndToEndTests/RestrictedControllers/UpdateResourceTests.cs @@ -67,7 +67,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = existingVideoStream.StringId! @@ -275,7 +275,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = unknownDataStreamId @@ -285,7 +285,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Type = DataStreamResourceType.DataStreams, Id = unknownDataStreamId diff --git a/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs b/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs index 2881c550d6..da0bebd334 100644 --- a/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs +++ b/test/OpenApiNSwagClientTests/LegacyOpenApi/RequestTests.cs @@ -69,7 +69,7 @@ public async Task Partial_posting_resource_with_selected_relationships_produces_ { Purser = new ToOneFlightAttendantInRequest { - Data = new FlightAttendantIdentifier + Data = new FlightAttendantIdentifierInRequest { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants @@ -77,7 +77,7 @@ public async Task Partial_posting_resource_with_selected_relationships_produces_ }, BackupPurser = new NullableToOneFlightAttendantInRequest { - Data = new FlightAttendantIdentifier + Data = new FlightAttendantIdentifierInRequest { Id = "NInmX", Type = FlightAttendantResourceType.FlightAttendants @@ -330,7 +330,7 @@ public async Task Patching_ToOne_relationship_produces_expected_request() var requestDocument = new ToOneFlightAttendantInRequest { - Data = new FlightAttendantIdentifier + Data = new FlightAttendantIdentifierInRequest { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants @@ -391,12 +391,12 @@ public async Task Posting_ToMany_relationship_produces_expected_request() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Type = FlightAttendantResourceType.FlightAttendants, Id = "bBJHu" }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Type = FlightAttendantResourceType.FlightAttendants, Id = "NInmX" @@ -444,12 +444,12 @@ public async Task Patching_ToMany_relationship_produces_expected_request() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "NInmX", Type = FlightAttendantResourceType.FlightAttendants @@ -497,12 +497,12 @@ public async Task Deleting_ToMany_relationship_produces_expected_request() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "bBJHu", Type = FlightAttendantResourceType.FlightAttendants }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "NInmX", Type = FlightAttendantResourceType.FlightAttendants diff --git a/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs b/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs index e72266965e..e203814256 100644 --- a/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs +++ b/test/OpenApiNSwagClientTests/LegacyOpenApi/ResponseTests.cs @@ -304,7 +304,7 @@ public async Task Posting_resource_translates_response() { Purser = new ToOneFlightAttendantInRequest { - Data = new FlightAttendantIdentifier + Data = new FlightAttendantIdentifierInRequest { Id = flightAttendantId, Type = FlightAttendantResourceType.FlightAttendants @@ -588,7 +588,7 @@ public async Task Patching_ToOne_relationship_translates_response() var requestBody = new ToOneFlightAttendantInRequest { - Data = new FlightAttendantIdentifier + Data = new FlightAttendantIdentifierInRequest { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants @@ -650,12 +650,12 @@ public async Task Posting_ToMany_relationship_produces_empty_response() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants @@ -681,12 +681,12 @@ public async Task Patching_ToMany_relationship_produces_empty_response() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants @@ -712,12 +712,12 @@ public async Task Deleting_ToMany_relationship_produces_empty_response() { Data = [ - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Adk2a", Type = FlightAttendantResourceType.FlightAttendants }, - new FlightAttendantIdentifier + new FlightAttendantIdentifierInRequest { Id = "Un37k", Type = FlightAttendantResourceType.FlightAttendants diff --git a/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs index aa3105b539..efd34ab622 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs @@ -41,6 +41,8 @@ public void Generated_endpoint_methods_are_named_as_expected() _ = nameof(GeneratedClient.HeadStaffMemberAsync); _ = nameof(GeneratedClient.PatchStaffMemberAsync); _ = nameof(GeneratedClient.DeleteStaffMemberAsync); + + _ = nameof(GeneratedClient.PostOperationsAsync); } [Fact] @@ -62,6 +64,9 @@ public void Generated_top_level_document_types_are_named_as_expected() _ = nameof(NullableStaffMemberIdentifierResponseDocument); _ = nameof(ErrorResponseDocument); + + _ = nameof(OperationsRequestDocument); + _ = nameof(OperationsResponseDocument); } [Fact] @@ -77,6 +82,23 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorLinks); } + [Fact] + public void Generated_operation_types_are_named_as_expected() + { + _ = nameof(CreateSupermarketOperation); + _ = nameof(UpdateSupermarketOperation); + _ = nameof(DeleteSupermarketOperation); + _ = nameof(UpdateSupermarketBackupStoreManagerRelationshipOperation); + _ = nameof(UpdateSupermarketCashiersRelationshipOperation); + _ = nameof(AddToSupermarketCashiersRelationshipOperation); + _ = nameof(RemoveFromSupermarketCashiersRelationshipOperation); + _ = nameof(UpdateSupermarketStoreManagerRelationshipOperation); + + _ = nameof(CreateStaffMemberOperation); + _ = nameof(UpdateStaffMemberOperation); + _ = nameof(DeleteStaffMemberOperation); + } + [Fact] public void Generated_resource_field_types_are_named_as_expected() { @@ -114,6 +136,18 @@ public void Generated_relationship_container_types_are_named_as_expected() _ = nameof(NullableToOneStaffMemberInResponse); _ = nameof(ToManyStaffMemberInRequest); _ = nameof(ToManyStaffMemberInResponse); + + _ = nameof(SupermarketBackupStoreManagerRelationshipIdentifier); + _ = nameof(SupermarketCashiersRelationshipIdentifier); + _ = nameof(SupermarketStoreManagerRelationshipIdentifier); + } + + [Fact] + public void Generated_relationship_name_enums_are_named_as_expected() + { + _ = nameof(SupermarketBackupStoreManagerRelationshipName.BackupStoreManager); + _ = nameof(SupermarketCashiersRelationshipName.Cashiers); + _ = nameof(SupermarketStoreManagerRelationshipName.StoreManager); } [Fact] @@ -123,6 +157,14 @@ public void Generated_resource_type_enums_are_named_as_expected() _ = nameof(StaffMemberResourceType.StaffMembers); } + [Fact] + public void Generated_operation_type_enums_are_named_as_expected() + { + _ = nameof(AddOperationCode.Add); + _ = nameof(UpdateOperationCode.Update); + _ = nameof(RemoveOperationCode.Remove); + } + [Fact] public void Generated_data_types_are_named_as_expected() { @@ -132,11 +174,14 @@ public void Generated_data_types_are_named_as_expected() _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); + _ = nameof(SupermarketIdentifierInRequest); + _ = nameof(DataInCreateStaffMemberRequest); _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(StaffMemberIdentifier); + _ = nameof(StaffMemberIdentifierInRequest); + _ = nameof(StaffMemberIdentifierInResponse); } [Fact] @@ -145,5 +190,9 @@ public void Generated_predefined_types_are_named_as_expected() _ = nameof(Jsonapi); _ = nameof(ErrorObject); _ = nameof(ErrorSource); + _ = nameof(Meta); + + _ = nameof(AtomicOperation); + _ = nameof(AtomicResult); } } diff --git a/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs index 9d18f6ead7..85ff237b20 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs @@ -41,6 +41,8 @@ public void Generated_endpoint_methods_are_named_as_expected() _ = nameof(GeneratedClient.HeadStaffMemberAsync); _ = nameof(GeneratedClient.PatchStaffMemberAsync); _ = nameof(GeneratedClient.DeleteStaffMemberAsync); + + _ = nameof(GeneratedClient.PostOperationsAsync); } [Fact] @@ -62,6 +64,9 @@ public void Generated_top_level_document_types_are_named_as_expected() _ = nameof(NullableStaffMemberIdentifierResponseDocument); _ = nameof(ErrorResponseDocument); + + _ = nameof(OperationsRequestDocument); + _ = nameof(OperationsResponseDocument); } [Fact] @@ -77,6 +82,23 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorLinks); } + [Fact] + public void Generated_operation_types_are_named_as_expected() + { + _ = nameof(CreateSupermarketOperation); + _ = nameof(UpdateSupermarketOperation); + _ = nameof(DeleteSupermarketOperation); + _ = nameof(UpdateSupermarketBackupStoreManagerRelationshipOperation); + _ = nameof(UpdateSupermarketCashiersRelationshipOperation); + _ = nameof(AddToSupermarketCashiersRelationshipOperation); + _ = nameof(RemoveFromSupermarketCashiersRelationshipOperation); + _ = nameof(UpdateSupermarketStoreManagerRelationshipOperation); + + _ = nameof(CreateStaffMemberOperation); + _ = nameof(UpdateStaffMemberOperation); + _ = nameof(DeleteStaffMemberOperation); + } + [Fact] public void Generated_resource_field_types_are_named_as_expected() { @@ -114,6 +136,18 @@ public void Generated_relationship_container_types_are_named_as_expected() _ = nameof(NullableToOneStaffMemberInResponse); _ = nameof(ToManyStaffMemberInRequest); _ = nameof(ToManyStaffMemberInResponse); + + _ = nameof(SupermarketBackupStoreManagerRelationshipIdentifier); + _ = nameof(SupermarketCashiersRelationshipIdentifier); + _ = nameof(SupermarketStoreManagerRelationshipIdentifier); + } + + [Fact] + public void Generated_relationship_name_enums_are_named_as_expected() + { + _ = nameof(SupermarketBackupStoreManagerRelationshipName.BackupStoreManager); + _ = nameof(SupermarketCashiersRelationshipName.Cashiers); + _ = nameof(SupermarketStoreManagerRelationshipName.StoreManager); } [Fact] @@ -123,6 +157,14 @@ public void Generated_resource_type_enums_are_named_as_expected() _ = nameof(StaffMemberResourceType.StaffMembers); } + [Fact] + public void Generated_operation_type_enums_are_named_as_expected() + { + _ = nameof(AddOperationCode.Add); + _ = nameof(UpdateOperationCode.Update); + _ = nameof(RemoveOperationCode.Remove); + } + [Fact] public void Generated_data_types_are_named_as_expected() { @@ -132,11 +174,14 @@ public void Generated_data_types_are_named_as_expected() _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); + _ = nameof(SupermarketIdentifierInRequest); + _ = nameof(DataInCreateStaffMemberRequest); _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(StaffMemberIdentifier); + _ = nameof(StaffMemberIdentifierInRequest); + _ = nameof(StaffMemberIdentifierInResponse); } [Fact] @@ -145,5 +190,9 @@ public void Generated_predefined_types_are_named_as_expected() _ = nameof(Jsonapi); _ = nameof(ErrorObject); _ = nameof(ErrorSource); + _ = nameof(Meta); + + _ = nameof(AtomicOperation); + _ = nameof(AtomicResult); } } diff --git a/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs index 3fd5aa9116..ae222b410a 100644 --- a/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs +++ b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs @@ -41,6 +41,8 @@ public void Generated_endpoint_methods_are_named_as_expected() _ = nameof(GeneratedClient.HeadStaffMemberAsync); _ = nameof(GeneratedClient.PatchStaffMemberAsync); _ = nameof(GeneratedClient.DeleteStaffMemberAsync); + + _ = nameof(GeneratedClient.PostOperationsAsync); } [Fact] @@ -62,6 +64,9 @@ public void Generated_top_level_document_types_are_named_as_expected() _ = nameof(NullableStaffMemberIdentifierResponseDocument); _ = nameof(ErrorResponseDocument); + + _ = nameof(OperationsRequestDocument); + _ = nameof(OperationsResponseDocument); } [Fact] @@ -77,6 +82,23 @@ public void Generated_link_types_are_named_as_expected() _ = nameof(ErrorLinks); } + [Fact] + public void Generated_operation_types_are_named_as_expected() + { + _ = nameof(CreateSupermarketOperation); + _ = nameof(UpdateSupermarketOperation); + _ = nameof(DeleteSupermarketOperation); + _ = nameof(UpdateSupermarketBackupStoreManagerRelationshipOperation); + _ = nameof(UpdateSupermarketCashiersRelationshipOperation); + _ = nameof(AddToSupermarketCashiersRelationshipOperation); + _ = nameof(RemoveFromSupermarketCashiersRelationshipOperation); + _ = nameof(UpdateSupermarketStoreManagerRelationshipOperation); + + _ = nameof(CreateStaffMemberOperation); + _ = nameof(UpdateStaffMemberOperation); + _ = nameof(DeleteStaffMemberOperation); + } + [Fact] public void Generated_resource_field_types_are_named_as_expected() { @@ -114,6 +136,18 @@ public void Generated_relationship_container_types_are_named_as_expected() _ = nameof(NullableToOneStaffMemberInResponse); _ = nameof(ToManyStaffMemberInRequest); _ = nameof(ToManyStaffMemberInResponse); + + _ = nameof(SupermarketBackupStoreManagerRelationshipIdentifier); + _ = nameof(SupermarketCashiersRelationshipIdentifier); + _ = nameof(SupermarketStoreManagerRelationshipIdentifier); + } + + [Fact] + public void Generated_relationship_name_enums_are_named_as_expected() + { + _ = nameof(SupermarketBackupStoreManagerRelationshipName.BackupStoreManager); + _ = nameof(SupermarketCashiersRelationshipName.Cashiers); + _ = nameof(SupermarketStoreManagerRelationshipName.StoreManager); } [Fact] @@ -123,6 +157,14 @@ public void Generated_resource_type_enums_are_named_as_expected() _ = nameof(StaffMemberResourceType.StaffMembers); } + [Fact] + public void Generated_operation_type_enums_are_named_as_expected() + { + _ = nameof(AddOperationCode.Add); + _ = nameof(UpdateOperationCode.Update); + _ = nameof(RemoveOperationCode.Remove); + } + [Fact] public void Generated_data_types_are_named_as_expected() { @@ -132,11 +174,14 @@ public void Generated_data_types_are_named_as_expected() _ = nameof(DataInUpdateSupermarketRequest); _ = nameof(SupermarketDataInResponse); + _ = nameof(SupermarketIdentifierInRequest); + _ = nameof(DataInCreateStaffMemberRequest); _ = nameof(DataInUpdateStaffMemberRequest); _ = nameof(StaffMemberDataInResponse); - _ = nameof(StaffMemberIdentifier); + _ = nameof(StaffMemberIdentifierInRequest); + _ = nameof(StaffMemberIdentifierInResponse); } [Fact] @@ -145,5 +190,9 @@ public void Generated_predefined_types_are_named_as_expected() _ = nameof(Jsonapi); _ = nameof(ErrorObject); _ = nameof(ErrorSource); + _ = nameof(Meta); + + _ = nameof(AtomicOperation); + _ = nameof(AtomicResult); } } diff --git a/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs new file mode 100644 index 0000000000..f932e0abe2 --- /dev/null +++ b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicCreateResourceTests.cs @@ -0,0 +1,201 @@ +using FluentAssertions; +using JsonApiDotNetCore.OpenApi.Client.NSwag; +using Microsoft.Extensions.DependencyInjection; +using OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; +using CreateTeacherOperation = OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode.CreateTeacherOperation; + +namespace OpenApiNSwagEndToEndTests.AtomicOperations; + +public sealed class AtomicCreateResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler; + private readonly OperationsFakers _fakers; + + public AtomicCreateResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_create_resource_with_attributes() + { + // Arrange + Teacher newTeacher = _fakers.Teacher.Generate(); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new CreateTeacherOperation + { + Data = new DataInCreateTeacherRequest + { + Attributes = new AttributesInCreateTeacherRequest + { + Name = newTeacher.Name, + EmailAddress = newTeacher.EmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(1); + TeacherDataInResponse teacherDataInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + + teacherDataInResponse.Attributes.Name.Should().Be(newTeacher.Name); + teacherDataInResponse.Attributes.EmailAddress.Should().Be(newTeacher.EmailAddress); + + long newTeacherId = long.Parse(teacherDataInResponse.Id); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.FirstWithIdAsync(newTeacherId); + + teacherInDatabase.Name.Should().Be(newTeacher.Name); + teacherInDatabase.EmailAddress.Should().Be(newTeacher.EmailAddress); + }); + } + + [Fact] + public async Task Can_create_resource_with_attributes_and_relationships() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + Course existingCourse = _fakers.Course.Generate(); + Enrollment newEnrollment = _fakers.Enrollment.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingStudent, existingCourse); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new CreateEnrollmentOperation + { + Data = new DataInCreateEnrollmentRequest + { + Attributes = new AttributesInCreateEnrollmentRequest + { + EnrolledAt = newEnrollment.EnrolledAt.ToDateTime(TimeOnly.MinValue) + }, + Relationships = new RelationshipsInCreateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Id = existingCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Id = existingStudent.StringId! + } + } + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(1); + EnrollmentDataInResponse enrollmentDataInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + + enrollmentDataInResponse.Attributes.EnrolledAt.Should().Be(newEnrollment.EnrolledAt.ToDateTime(TimeOnly.MinValue)); + enrollmentDataInResponse.Attributes.GraduatedAt.Should().BeNull(); + enrollmentDataInResponse.Attributes.HasGraduated.Should().BeFalse(); + + long newEnrollmentId = long.Parse(enrollmentDataInResponse.Id); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment enrollmentInDatabase = await dbContext.Enrollments.FirstWithIdAsync(newEnrollmentId); + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrollment.EnrolledAt); + enrollmentInDatabase.GraduatedAt.Should().BeNull(); + enrollmentInDatabase.HasGraduated.Should().BeFalse(); + }); + } + + [Fact] + public async Task Can_create_resource_with_client_generated_ID() + { + // Arrange + Course newCourse = _fakers.Course.Generate(); + newCourse.Id = Guid.NewGuid(); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new CreateCourseOperation + { + Data = new DataInCreateCourseRequest + { + Id = newCourse.StringId!, + Attributes = new AttributesInCreateCourseRequest + { + Subject = newCourse.Subject + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Course courseInDatabase = await dbContext.Courses.FirstWithIdAsync(newCourse.Id); + + courseInDatabase.Subject.Should().Be(newCourse.Subject); + courseInDatabase.Description.Should().BeNull(); + }); + } +} diff --git a/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs new file mode 100644 index 0000000000..5424de6977 --- /dev/null +++ b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicDeleteResourceTests.cs @@ -0,0 +1,76 @@ +using FluentAssertions; +using JsonApiDotNetCore.OpenApi.Client.NSwag; +using Microsoft.Extensions.DependencyInjection; +using OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiNSwagEndToEndTests.AtomicOperations; + +public sealed class AtomicDeleteResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler; + private readonly OperationsFakers _fakers; + + public AtomicDeleteResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_delete_resource() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Enrollments.Add(existingEnrollment); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new DeleteEnrollmentOperation + { + Ref = new EnrollmentIdentifierInRequest + { + Id = existingEnrollment.StringId! + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment? enrollmentInDatabase = await dbContext.Enrollments.FirstWithIdOrDefaultAsync(existingEnrollment.Id); + + enrollmentInDatabase.Should().BeNull(); + }); + } +} diff --git a/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs new file mode 100644 index 0000000000..89ac538fd3 --- /dev/null +++ b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicLocalIdTests.cs @@ -0,0 +1,212 @@ +using FluentAssertions; +using JsonApiDotNetCore.OpenApi.Client.NSwag; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiNSwagEndToEndTests.AtomicOperations; + +public sealed class AtomicLocalIdTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler; + private readonly OperationsFakers _fakers; + + public AtomicLocalIdTests(IntegrationTestContext, OperationsDbContext> testContext, ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_use_local_IDs() + { + // Arrange + Teacher newTeacher = _fakers.Teacher.Generate(); + Course newCourse = _fakers.Course.Generate(); + newCourse.Id = Guid.NewGuid(); + Student newStudent = _fakers.Student.Generate(); + DateOnly newEnrolledAt = _fakers.Enrollment.Generate().EnrolledAt; + + const string teacherLocalId = "teacher-1"; + const string studentLocalId = "student-1"; + const string enrollmentLocalId = "enrollment-1"; + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new CreateTeacherOperation + { + Data = new DataInCreateTeacherRequest + { + Lid = teacherLocalId, + Attributes = new AttributesInCreateTeacherRequest + { + Name = newTeacher.Name, + EmailAddress = newTeacher.EmailAddress + } + } + }, + new CreateCourseOperation + { + Data = new DataInCreateCourseRequest + { + Id = newCourse.StringId!, + Attributes = new AttributesInCreateCourseRequest + { + Subject = newCourse.Subject, + Description = newCourse.Description + } + } + }, + new AddToTeacherTeachesRelationshipOperation + { + Ref = new TeacherTeachesRelationshipIdentifier + { + Lid = teacherLocalId + }, + Data = + [ + new CourseIdentifierInRequest + { + Id = newCourse.StringId! + } + ] + }, + new CreateStudentOperation + { + Data = new DataInCreateStudentRequest + { + Lid = studentLocalId, + Attributes = new AttributesInCreateStudentRequest + { + Name = newStudent.Name, + EmailAddress = newStudent.EmailAddress + } + } + }, + new CreateEnrollmentOperation + { + Data = new DataInCreateEnrollmentRequest + { + Lid = enrollmentLocalId, + Attributes = new AttributesInCreateEnrollmentRequest + { + EnrolledAt = newEnrolledAt.ToDateTime(TimeOnly.MinValue) + }, + Relationships = new RelationshipsInCreateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Id = newCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Lid = studentLocalId + } + } + } + } + }, + new UpdateStudentMentorRelationshipOperation + { + Ref = new StudentMentorRelationshipIdentifier + { + Lid = studentLocalId + }, + Data = new TeacherIdentifierInRequest + { + Lid = teacherLocalId + } + }, + new DeleteTeacherOperation + { + Ref = new TeacherIdentifierInRequest + { + Lid = teacherLocalId + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(7); + + TeacherDataInResponse teacherInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + teacherInResponse.Attributes.Name.Should().Be(newTeacher.Name); + teacherInResponse.Attributes.EmailAddress.Should().Be(newTeacher.EmailAddress); + long newTeacherId = long.Parse(teacherInResponse.Id); + + response.Atomic_results.ElementAt(1).Data.Should().BeNull(); + response.Atomic_results.ElementAt(2).Data.Should().BeNull(); + + StudentDataInResponse studentInResponse = response.Atomic_results.ElementAt(3).Data.Should().BeOfType().Which; + studentInResponse.Attributes.Name.Should().Be(newStudent.Name); + studentInResponse.Attributes.EmailAddress.Should().Be(newStudent.EmailAddress); + long newStudentId = long.Parse(studentInResponse.Id); + + EnrollmentDataInResponse enrollmentInResponse = response.Atomic_results.ElementAt(4).Data.Should().BeOfType().Which; + enrollmentInResponse.Attributes.EnrolledAt.Should().Be(newEnrolledAt.ToDateTime(TimeOnly.MinValue)); + long newEnrollmentId = long.Parse(enrollmentInResponse.Id); + + response.Atomic_results.ElementAt(5).Data.Should().BeNull(); + response.Atomic_results.ElementAt(6).Data.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher? teacherInDatabase = await dbContext.Teachers.FirstWithIdOrDefaultAsync(newTeacherId); + teacherInDatabase.Should().BeNull(); + + Course courseInDatabase = await dbContext.Courses.Include(course => course.TaughtBy).FirstWithIdAsync(newCourse.Id); + courseInDatabase.Subject.Should().Be(newCourse.Subject); + courseInDatabase.Description.Should().Be(newCourse.Description); + courseInDatabase.TaughtBy.Should().BeEmpty(); + + Student studentInDatabase = await dbContext.Students.Include(student => student.Mentor).FirstWithIdAsync(newStudentId); + studentInDatabase.Name.Should().Be(newStudent.Name); + studentInDatabase.EmailAddress.Should().Be(newStudent.EmailAddress); + studentInDatabase.Mentor.Should().BeNull(); + + // @formatter:wrap_chained_method_calls chop_always + // @formatter:keep_existing_linebreaks true + + Enrollment enrollmentInDatabase = await dbContext.Enrollments + .Include(enrollment => enrollment.Course) + .Include(enrollment => enrollment.Student) + .FirstWithIdAsync(newEnrollmentId); + + // @formatter:keep_existing_linebreaks restore + // @formatter:wrap_chained_method_calls restore + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrolledAt); + enrollmentInDatabase.Course.ShouldNotBeNull(); + enrollmentInDatabase.Course.Id.Should().Be(newCourse.Id); + enrollmentInDatabase.Student.Id.Should().Be(newStudentId); + }); + } +} diff --git a/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs new file mode 100644 index 0000000000..61849c595e --- /dev/null +++ b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicRelationshipTests.cs @@ -0,0 +1,259 @@ +using FluentAssertions; +using JsonApiDotNetCore.OpenApi.Client.NSwag; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiNSwagEndToEndTests.AtomicOperations; + +public sealed class AtomicRelationshipTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler; + private readonly OperationsFakers _fakers; + + public AtomicRelationshipTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_update_ToOne_relationship() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + Student existingStudent = _fakers.Student.Generate(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingEnrollment, existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new UpdateEnrollmentStudentRelationshipOperation + { + Ref = new EnrollmentStudentRelationshipIdentifier + { + Id = existingEnrollment.StringId! + }, + Data = new StudentIdentifierInRequest + { + Id = existingStudent.StringId! + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Enrollment enrollmentInDatabase = await dbContext.Enrollments.Include(enrollment => enrollment.Student).FirstWithIdAsync(existingEnrollment.Id); + + enrollmentInDatabase.Student.ShouldNotBeNull(); + enrollmentInDatabase.Student.Id.Should().Be(existingStudent.Id); + }); + } + + [Fact] + public async Task Can_update_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(1).ToHashSet(); + List existingCourses = _fakers.Course.Generate(2).ToList(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + dbContext.AddRange(existingCourses); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new UpdateTeacherTeachesRelationshipOperation + { + Ref = new TeacherTeachesRelationshipIdentifier + { + Id = existingTeacher.StringId! + }, + Data = + [ + new CourseIdentifierInRequest + { + Id = existingCourses.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Id = existingCourses.ElementAt(1).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(2); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(1).Id); + }); + } + + [Fact] + public async Task Can_add_to_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(1).ToHashSet(); + List existingCourses = _fakers.Course.Generate(2).ToList(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + dbContext.AddRange(existingCourses); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new AddToTeacherTeachesRelationshipOperation + { + Ref = new TeacherTeachesRelationshipIdentifier + { + Id = existingTeacher.StringId! + }, + Data = + [ + new CourseIdentifierInRequest + { + Id = existingCourses.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Id = existingCourses.ElementAt(1).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(3); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingTeacher.Teaches.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(0).Id); + teacherInDatabase.Teaches.Should().ContainSingle(course => course.Id == existingCourses.ElementAt(1).Id); + }); + } + + [Fact] + public async Task Can_remove_from_ToMany_relationship() + { + // Arrange + Teacher existingTeacher = _fakers.Teacher.Generate(); + existingTeacher.Teaches = _fakers.Course.Generate(3).ToHashSet(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Add(existingTeacher); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new RemoveFromTeacherTeachesRelationshipOperation + { + Ref = new TeacherTeachesRelationshipIdentifier + { + Id = existingTeacher.StringId! + }, + Data = + [ + new CourseIdentifierInRequest + { + Id = existingTeacher.Teaches.ElementAt(0).StringId! + }, + new CourseIdentifierInRequest + { + Id = existingTeacher.Teaches.ElementAt(2).StringId! + } + ] + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.Should().BeNull(); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Teacher teacherInDatabase = await dbContext.Teachers.Include(teacher => teacher.Teaches).FirstWithIdAsync(existingTeacher.Id); + + teacherInDatabase.Teaches.ShouldHaveCount(1); + teacherInDatabase.Teaches.ElementAt(0).Id.Should().Be(existingTeacher.Teaches.ElementAt(1).Id); + }); + } +} diff --git a/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs new file mode 100644 index 0000000000..853155aa92 --- /dev/null +++ b/test/OpenApiNSwagEndToEndTests/AtomicOperations/AtomicUpdateResourceTests.cs @@ -0,0 +1,250 @@ +using FluentAssertions; +using JsonApiDotNetCore.OpenApi.Client.NSwag; +using JsonApiDotNetCore.Resources; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode; +using OpenApiTests; +using OpenApiTests.AtomicOperations; +using TestBuildingBlocks; +using Xunit; +using Xunit.Abstractions; + +namespace OpenApiNSwagEndToEndTests.AtomicOperations; + +public sealed class AtomicUpdateResourceTests : IClassFixture, OperationsDbContext>> +{ + private readonly IntegrationTestContext, OperationsDbContext> _testContext; + private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler; + private readonly OperationsFakers _fakers; + + public AtomicUpdateResourceTests(IntegrationTestContext, OperationsDbContext> testContext, + ITestOutputHelper testOutputHelper) + { + _testContext = testContext; + _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper); + + testContext.UseController(); + + testContext.ConfigureServices(services => + { + services.AddSingleton(); + services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); + }); + + _fakers = new OperationsFakers(testContext.Factory.Services); + } + + [Fact] + public async Task Can_update_resource_with_attributes() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + string newName = _fakers.Student.Generate().Name; + string? newEmailAddress = _fakers.Student.Generate().EmailAddress; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Students.Add(existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new UpdateStudentOperation + { + Data = new DataInUpdateStudentRequest + { + Id = existingStudent.StringId!, + Attributes = new AttributesInUpdateStudentRequest + { + Name = newName, + EmailAddress = newEmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(1); + StudentDataInResponse studentDataInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + + studentDataInResponse.Id.Should().Be(existingStudent.StringId); + studentDataInResponse.Attributes.Name.Should().Be(newName); + studentDataInResponse.Attributes.EmailAddress.Should().Be(newEmailAddress); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Student studentInDatabase = await dbContext.Students.FirstWithIdAsync(existingStudent.Id); + + studentInDatabase.Name.Should().Be(newName); + studentInDatabase.EmailAddress.Should().Be(newEmailAddress); + }); + } + + [Fact] + public async Task Can_update_resource_with_attributes_using_ref() + { + // Arrange + Student existingStudent = _fakers.Student.Generate(); + string? newEmailAddress = _fakers.Student.Generate().EmailAddress; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.Students.Add(existingStudent); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new UpdateStudentOperation + { + Ref = new StudentIdentifierInRequest + { + Id = existingStudent.StringId! + }, + Data = new DataInUpdateStudentRequest + { + Id = existingStudent.StringId!, + Attributes = new AttributesInUpdateStudentRequest + { + EmailAddress = newEmailAddress + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(1); + StudentDataInResponse studentDataInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + + studentDataInResponse.Id.Should().Be(existingStudent.StringId); + studentDataInResponse.Attributes.Name.Should().Be(existingStudent.Name); + studentDataInResponse.Attributes.EmailAddress.Should().Be(newEmailAddress); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + Student studentInDatabase = await dbContext.Students.FirstWithIdAsync(existingStudent.Id); + + studentInDatabase.Name.Should().Be(existingStudent.Name); + studentInDatabase.EmailAddress.Should().Be(newEmailAddress); + }); + } + + [Fact] + public async Task Can_update_resource_with_attributes_and_relationships() + { + // Arrange + Enrollment existingEnrollment = _fakers.Enrollment.Generate(); + existingEnrollment.Student = _fakers.Student.Generate(); + existingEnrollment.Course = _fakers.Course.Generate(); + + Student existingStudent = _fakers.Student.Generate(); + Course existingCourse = _fakers.Course.Generate(); + DateOnly newEnrolledAt = _fakers.Enrollment.Generate().EnrolledAt; + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + dbContext.AddInRange(existingEnrollment, existingStudent, existingCourse); + await dbContext.SaveChangesAsync(); + }); + + using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler); + var apiClient = new AtomicOperationsClient(httpClient); + + OperationsRequestDocument requestBody = new() + { + Atomic_operations = + [ + new UpdateEnrollmentOperation + { + Data = new DataInUpdateEnrollmentRequest + { + Id = existingEnrollment.StringId!, + Attributes = new AttributesInUpdateEnrollmentRequest + { + EnrolledAt = newEnrolledAt.ToDateTime(TimeOnly.MinValue) + }, + Relationships = new RelationshipsInUpdateEnrollmentRequest + { + Course = new ToOneCourseInRequest + { + Data = new CourseIdentifierInRequest + { + Id = existingCourse.StringId! + } + }, + Student = new ToOneStudentInRequest + { + Data = new StudentIdentifierInRequest + { + Id = existingStudent.StringId! + } + } + } + } + } + ] + }; + + // Act + OperationsResponseDocument? response = await ApiResponse.TranslateAsync(async () => await apiClient.PostOperationsAsync(requestBody)); + + // Assert + response.ShouldNotBeNull(); + + response.Atomic_results.ShouldHaveCount(1); + EnrollmentDataInResponse enrollmentDataInResponse = response.Atomic_results.ElementAt(0).Data.Should().BeOfType().Which; + + enrollmentDataInResponse.Id.Should().Be(existingEnrollment.StringId); + enrollmentDataInResponse.Attributes.EnrolledAt.Should().Be(newEnrolledAt.ToDateTime(TimeOnly.MinValue)); + enrollmentDataInResponse.Attributes.GraduatedAt.Should().Be(existingEnrollment.GraduatedAt!.Value.ToDateTime(TimeOnly.MinValue)); + enrollmentDataInResponse.Attributes.HasGraduated.Should().Be(existingEnrollment.HasGraduated); + + await _testContext.RunOnDatabaseAsync(async dbContext => + { + // @formatter:wrap_chained_method_calls chop_always + // @formatter:keep_existing_linebreaks true + + Enrollment enrollmentInDatabase = await dbContext.Enrollments + .Include(enrollment => enrollment.Student) + .Include(enrollment => enrollment.Course) + .FirstWithIdAsync(existingEnrollment.Id); + + // @formatter:keep_existing_linebreaks restore + // @formatter:wrap_chained_method_calls restore + + enrollmentInDatabase.EnrolledAt.Should().Be(newEnrolledAt); + enrollmentInDatabase.GraduatedAt.Should().Be(existingEnrollment.GraduatedAt); + enrollmentInDatabase.HasGraduated.Should().Be(existingEnrollment.HasGraduated); + + enrollmentInDatabase.Student.ShouldNotBeNull(); + enrollmentInDatabase.Student.Id.Should().Be(existingStudent.Id); + + enrollmentInDatabase.Course.ShouldNotBeNull(); + enrollmentInDatabase.Course.Id.Should().Be(existingCourse.Id); + }); + } +} diff --git a/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj b/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj index 8277343c19..55f5a14995 100644 --- a/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj +++ b/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj @@ -65,5 +65,12 @@ NSwagCSharp /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true + + OpenApiNSwagEndToEndTests.AtomicOperations.GeneratedCode + AtomicOperationsClient + AtomicOperationsClient.cs + NSwagCSharp + /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true + diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs index 7fad959f3f..3cdbcf3b32 100644 --- a/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs +++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs @@ -53,8 +53,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.ElementAt(0).Id.Should().Be(node.StringId); response.Included.ShouldHaveCount(2); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values.ElementAt(0).StringId); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values.ElementAt(1).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values.ElementAt(0).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values.ElementAt(1).StringId); } [Fact] @@ -87,9 +91,15 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.Id.Should().Be(node.StringId); response.Included.ShouldHaveCount(3); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Children.ElementAt(0).StringId); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Children.ElementAt(1).StringId); - response.Included.Should().ContainSingle(include => include is NameValuePairDataInResponse && include.Id == node.Values[0].StringId); + + response.Included.Should().ContainSingle(include => + include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Children.ElementAt(0).StringId); + + response.Included.Should().ContainSingle(include => + include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Children.ElementAt(1).StringId); + + response.Included.Should().ContainSingle(include => + include is NameValuePairDataInResponse && ((NameValuePairDataInResponse)include).Id == node.Values[0].StringId); } [Fact] @@ -122,8 +132,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext => response.Data.ShouldHaveCount(2); response.Included.ShouldHaveCount(2); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.StringId); - response.Included.Should().ContainSingle(include => include is NodeDataInResponse && include.Id == node.Parent.StringId); + response.Included.Should().ContainSingle(include => include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.StringId); + response.Included.Should().ContainSingle(include => include is NodeDataInResponse && ((NodeDataInResponse)include).Id == node.Parent.StringId); } [Fact] diff --git a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs index 30b57de06b..6168fe2d82 100644 --- a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs +++ b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/CreateResourceTests.cs @@ -56,7 +56,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Id = existingVideoStream.StringId! } @@ -65,7 +65,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = existingAudioStream.StringId! } @@ -171,7 +171,7 @@ public async Task Cannot_create_resource_with_unknown_relationship_ID() { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Id = unknownVideoStreamId } diff --git a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs index 90485d2730..c3032cad08 100644 --- a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs +++ b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs @@ -48,7 +48,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => var requestBody = new NullableToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Id = existingVideoStream.StringId! } @@ -141,7 +141,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = existingAudioStream.StringId! } @@ -235,7 +235,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = existingAudioStream.StringId! } @@ -284,11 +284,11 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = existingChannel.AudioStreams.ElementAt(0).StringId! }, - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = existingChannel.AudioStreams.ElementAt(1).StringId! } @@ -365,11 +365,11 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = unknownAudioStreamId1 }, - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = unknownAudioStreamId2 } diff --git a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs index cf8b1c62f0..910b635b32 100644 --- a/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs +++ b/test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateResourceTests.cs @@ -65,7 +65,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Id = existingVideoStream.StringId! } @@ -257,7 +257,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { VideoStream = new ToOneDataStreamInRequest { - Data = new DataStreamIdentifier + Data = new DataStreamIdentifierInRequest { Id = unknownDataStreamId } @@ -266,7 +266,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext => { Data = [ - new DataStreamIdentifier + new DataStreamIdentifierInRequest { Id = unknownDataStreamId } diff --git a/test/OpenApiTests/AtomicOperations/Course.cs b/test/OpenApiTests/AtomicOperations/Course.cs new file mode 100644 index 0000000000..de193c6893 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/Course.cs @@ -0,0 +1,25 @@ +using JetBrains.Annotations; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Resources; +using JsonApiDotNetCore.Resources.Annotations; + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +[Resource(ControllerNamespace = "OpenApiTests.AtomicOperations", GenerateControllerEndpoints = JsonApiEndpoints.All & ~JsonApiEndpoints.DeleteRelationship, + ClientIdGeneration = ClientIdGenerationMode.Required)] +public sealed class Course : Identifiable +{ + [Attr] + public string Subject { get; set; } = null!; + + [Attr] + public string? Description { get; set; } + + [HasMany(Capabilities = HasManyCapabilities.All & ~HasManyCapabilities.AllowSet)] + public ISet TaughtBy { get; set; } = new HashSet(); + + [HasMany] + public ISet Enrollments { get; set; } = new HashSet(); +} diff --git a/test/OpenApiTests/AtomicOperations/Enrollment.cs b/test/OpenApiTests/AtomicOperations/Enrollment.cs new file mode 100644 index 0000000000..5a8bfa0c70 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/Enrollment.cs @@ -0,0 +1,30 @@ +using JetBrains.Annotations; +using JsonApiDotNetCore.Resources; +using JsonApiDotNetCore.Resources.Annotations; +using TestBuildingBlocks; + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +[Resource(ControllerNamespace = "OpenApiTests.AtomicOperations")] +public sealed class Enrollment(OperationsDbContext dbContext) : Identifiable +{ + private readonly ISystemClock _systemClock = dbContext.SystemClock; + + private DateOnly Today => DateOnly.FromDateTime(_systemClock.UtcNow.Date); + + [Attr] + public DateOnly EnrolledAt { get; set; } + + [Attr] + public DateOnly? GraduatedAt { get; set; } + + [Attr] + public bool HasGraduated => GraduatedAt != null && GraduatedAt <= Today; + + [HasOne] + public Student Student { get; set; } = null!; + + [HasOne] + public Course Course { get; set; } = null!; +} diff --git a/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json new file mode 100644 index 0000000000..1529c7cdb5 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/GeneratedSwagger/swagger.g.json @@ -0,0 +1,10180 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "OpenApiTests", + "version": "1.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/courses": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves a collection of courses.", + "operationId": "getCourseCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found courses, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/courseCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves a collection of courses without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourseCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + } + } + }, + "post": { + "tags": [ + "courses" + ], + "summary": "Creates a new course.", + "operationId": "postCourse", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the course to create.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/createCourseRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The course was successfully created, which resulted in additional changes. The newly created course is returned.", + "headers": { + "Location": { + "description": "The URL at which the newly created course can be retrieved.", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/coursePrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The course was successfully created, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/courses/{id}": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves an individual course by its identifier.", + "operationId": "getCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found course.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/coursePrimaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves an individual course by its identifier without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The course does not exist." + } + } + }, + "patch": { + "tags": [ + "courses" + ], + "summary": "Updates an existing course.", + "operationId": "patchCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to update.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the course to update. Omitted fields are left unchanged.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/updateCourseRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The course was successfully updated, which resulted in additional changes. The updated course is returned.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/coursePrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The course was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "A resource type or identifier in the request body is incompatible.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "courses" + ], + "summary": "Deletes an existing course by its identifier.", + "operationId": "deleteCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The course was successfully deleted." + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/courses/{id}/enrollments": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related enrollments of an individual course's enrollments relationship.", + "operationId": "getCourseEnrollments", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related enrollments to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollments, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related enrollments of an individual course's enrollments relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourseEnrollments", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related enrollments to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The course does not exist." + } + } + } + }, + "/courses/{id}/relationships/enrollments": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related enrollment identities of an individual course's enrollments relationship.", + "operationId": "getCourseEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related enrollment identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollment identities, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentIdentifierCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related enrollment identities of an individual course's enrollments relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourseEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related enrollment identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The course does not exist." + } + } + }, + "post": { + "tags": [ + "courses" + ], + "summary": "Adds existing enrollments to the enrollments relationship of an individual course.", + "operationId": "postCourseEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to add enrollments to.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the enrollments to add to the enrollments relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The enrollments were successfully added, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "patch": { + "tags": [ + "courses" + ], + "summary": "Assigns existing enrollments to the enrollments relationship of an individual course.", + "operationId": "patchCourseEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose enrollments relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the enrollments to assign to the enrollments relationship, or an empty array to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The enrollments relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/courses/{id}/taughtBy": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related teachers of an individual course's taughtBy relationship.", + "operationId": "getCourseTaughtBy", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related teachers to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teachers, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related teachers of an individual course's taughtBy relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourseTaughtBy", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related teachers to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The course does not exist." + } + } + } + }, + "/courses/{id}/relationships/taughtBy": { + "get": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related teacher identities of an individual course's taughtBy relationship.", + "operationId": "getCourseTaughtByRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related teacher identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teacher identities, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherIdentifierCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "courses" + ], + "summary": "Retrieves the related teacher identities of an individual course's taughtBy relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headCourseTaughtByRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose related teacher identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The course does not exist." + } + } + }, + "post": { + "tags": [ + "courses" + ], + "summary": "Adds existing teachers to the taughtBy relationship of an individual course.", + "operationId": "postCourseTaughtByRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course to add teachers to.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the teachers to add to the taughtBy relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The teachers were successfully added, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "patch": { + "tags": [ + "courses" + ], + "summary": "Assigns existing teachers to the taughtBy relationship of an individual course.", + "operationId": "patchCourseTaughtByRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the course whose taughtBy relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the teachers to assign to the taughtBy relationship, or an empty array to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The taughtBy relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The course or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/enrollments": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves a collection of enrollments.", + "operationId": "getEnrollmentCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollments, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves a collection of enrollments without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollmentCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + } + } + }, + "post": { + "tags": [ + "enrollments" + ], + "summary": "Creates a new enrollment.", + "operationId": "postEnrollment", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the enrollment to create.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/createEnrollmentRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The enrollment was successfully created, which resulted in additional changes. The newly created enrollment is returned.", + "headers": { + "Location": { + "description": "The URL at which the newly created enrollment can be retrieved.", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The enrollment was successfully created, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "Client-generated IDs cannot be used at this endpoint.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/enrollments/{id}": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves an individual enrollment by its identifier.", + "operationId": "getEnrollment", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollment.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentPrimaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves an individual enrollment by its identifier without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollment", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The enrollment does not exist." + } + } + }, + "patch": { + "tags": [ + "enrollments" + ], + "summary": "Updates an existing enrollment.", + "operationId": "patchEnrollment", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment to update.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the enrollment to update. Omitted fields are left unchanged.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/updateEnrollmentRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The enrollment was successfully updated, which resulted in additional changes. The updated enrollment is returned.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The enrollment was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "A resource type or identifier in the request body is incompatible.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "enrollments" + ], + "summary": "Deletes an existing enrollment by its identifier.", + "operationId": "deleteEnrollment", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The enrollment was successfully deleted." + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/enrollments/{id}/course": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related course of an individual enrollment's course relationship.", + "operationId": "getEnrollmentCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related course to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found course, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/courseSecondaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related course of an individual enrollment's course relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollmentCourse", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related course to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The enrollment does not exist." + } + } + } + }, + "/enrollments/{id}/relationships/course": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related course identity of an individual enrollment's course relationship.", + "operationId": "getEnrollmentCourseRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related course identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found course identity, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/courseIdentifierResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related course identity of an individual enrollment's course relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollmentCourseRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related course identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The enrollment does not exist." + } + } + }, + "patch": { + "tags": [ + "enrollments" + ], + "summary": "Assigns an existing course to the course relationship of an individual enrollment.", + "operationId": "patchEnrollmentCourseRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose course relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identity of the course to assign to the course relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The course relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/enrollments/{id}/student": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related student of an individual enrollment's student relationship.", + "operationId": "getEnrollmentStudent", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related student to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found student, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentSecondaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related student of an individual enrollment's student relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollmentStudent", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related student to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The enrollment does not exist." + } + } + } + }, + "/enrollments/{id}/relationships/student": { + "get": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related student identity of an individual enrollment's student relationship.", + "operationId": "getEnrollmentStudentRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related student identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found student identity, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentIdentifierResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "enrollments" + ], + "summary": "Retrieves the related student identity of an individual enrollment's student relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headEnrollmentStudentRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose related student identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The enrollment does not exist." + } + } + }, + "patch": { + "tags": [ + "enrollments" + ], + "summary": "Assigns an existing student to the student relationship of an individual enrollment.", + "operationId": "patchEnrollmentStudentRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the enrollment whose student relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identity of the student to assign to the student relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The student relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The enrollment or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/operations": { + "post": { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "postOperations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/operationsRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/operationsResponseDocument" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/students": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves a collection of students.", + "operationId": "getStudentCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found students, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves a collection of students without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudentCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + } + } + }, + "post": { + "tags": [ + "students" + ], + "summary": "Creates a new student.", + "operationId": "postStudent", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the student to create.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/createStudentRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The student was successfully created, which resulted in additional changes. The newly created student is returned.", + "headers": { + "Location": { + "description": "The URL at which the newly created student can be retrieved.", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The student was successfully created, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "Client-generated IDs cannot be used at this endpoint.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/students/{id}": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves an individual student by its identifier.", + "operationId": "getStudent", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found student.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentPrimaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves an individual student by its identifier without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudent", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The student does not exist." + } + } + }, + "patch": { + "tags": [ + "students" + ], + "summary": "Updates an existing student.", + "operationId": "patchStudent", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student to update.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the student to update. Omitted fields are left unchanged.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/updateStudentRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The student was successfully updated, which resulted in additional changes. The updated student is returned.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The student was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "A resource type or identifier in the request body is incompatible.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/students/{id}/enrollments": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves the related enrollments of an individual student's enrollments relationship.", + "operationId": "getStudentEnrollments", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related enrollments to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollments, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves the related enrollments of an individual student's enrollments relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudentEnrollments", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related enrollments to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The student does not exist." + } + } + } + }, + "/students/{id}/relationships/enrollments": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves the related enrollment identities of an individual student's enrollments relationship.", + "operationId": "getStudentEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related enrollment identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found enrollment identities, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/enrollmentIdentifierCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves the related enrollment identities of an individual student's enrollments relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudentEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related enrollment identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The student does not exist." + } + } + }, + "post": { + "tags": [ + "students" + ], + "summary": "Adds existing enrollments to the enrollments relationship of an individual student.", + "operationId": "postStudentEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student to add enrollments to.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the enrollments to add to the enrollments relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The enrollments were successfully added, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "patch": { + "tags": [ + "students" + ], + "summary": "Assigns existing enrollments to the enrollments relationship of an individual student.", + "operationId": "patchStudentEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose enrollments relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the enrollments to assign to the enrollments relationship, or an empty array to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The enrollments relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "students" + ], + "summary": "Removes existing enrollments from the enrollments relationship of an individual student.", + "operationId": "deleteStudentEnrollmentsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student to remove enrollments from.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the enrollments to remove from the enrollments relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The enrollments were successfully removed, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/students/{id}/mentor": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves the related teacher of an individual student's mentor relationship.", + "operationId": "getStudentMentor", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related teacher to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teacher, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/nullableTeacherSecondaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves the related teacher of an individual student's mentor relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudentMentor", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related teacher to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The student does not exist." + } + } + } + }, + "/students/{id}/relationships/mentor": { + "get": { + "tags": [ + "students" + ], + "summary": "Retrieves the related teacher identity of an individual student's mentor relationship.", + "operationId": "getStudentMentorRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related teacher identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teacher identity, or `null` if it was not found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/nullableTeacherIdentifierResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "students" + ], + "summary": "Retrieves the related teacher identity of an individual student's mentor relationship without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headStudentMentorRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose related teacher identity to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The student does not exist." + } + } + }, + "patch": { + "tags": [ + "students" + ], + "summary": "Clears or assigns an existing teacher to the mentor relationship of an individual student.", + "operationId": "patchStudentMentorRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the student whose mentor relationship to assign or clear.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identity of the teacher to assign to the mentor relationship, or `null` to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The mentor relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The student or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/teachers": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves a collection of teachers.", + "operationId": "getTeacherCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teachers, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves a collection of teachers without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacherCollection", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + } + } + }, + "post": { + "tags": [ + "teachers" + ], + "summary": "Creates a new teacher.", + "operationId": "postTeacher", + "parameters": [ + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the teacher to create.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/createTeacherRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "The teacher was successfully created, which resulted in additional changes. The newly created teacher is returned.", + "headers": { + "Location": { + "description": "The URL at which the newly created teacher can be retrieved.", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The teacher was successfully created, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "Client-generated IDs cannot be used at this endpoint.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/teachers/{id}": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves an individual teacher by its identifier.", + "operationId": "getTeacher", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found teacher.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherPrimaryResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves an individual teacher by its identifier without returning it.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacher", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The teacher does not exist." + } + } + }, + "patch": { + "tags": [ + "teachers" + ], + "summary": "Updates an existing teacher.", + "operationId": "patchTeacher", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to update.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + } + ], + "requestBody": { + "description": "The attributes and relationships of the teacher to update. Omitted fields are left unchanged.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/updateTeacherRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The teacher was successfully updated, which resulted in additional changes. The updated teacher is returned.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/teacherPrimaryResponseDocument" + } + } + } + }, + "204": { + "description": "The teacher was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The query string is invalid or the request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "A resource type or identifier in the request body is incompatible.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "teachers" + ], + "summary": "Deletes an existing teacher by its identifier.", + "operationId": "deleteTeacher", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to delete.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The teacher was successfully deleted." + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/teachers/{id}/mentors": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related students of an individual teacher's mentors relationship.", + "operationId": "getTeacherMentors", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related students to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found students, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related students of an individual teacher's mentors relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacherMentors", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related students to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The teacher does not exist." + } + } + } + }, + "/teachers/{id}/relationships/mentors": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related student identities of an individual teacher's mentors relationship.", + "operationId": "getTeacherMentorsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related student identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found student identities, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/studentIdentifierCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related student identities of an individual teacher's mentors relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacherMentorsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related student identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The teacher does not exist." + } + } + }, + "post": { + "tags": [ + "teachers" + ], + "summary": "Adds existing students to the mentors relationship of an individual teacher.", + "operationId": "postTeacherMentorsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to add students to.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the students to add to the mentors relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The students were successfully added, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "patch": { + "tags": [ + "teachers" + ], + "summary": "Assigns existing students to the mentors relationship of an individual teacher.", + "operationId": "patchTeacherMentorsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose mentors relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the students to assign to the mentors relationship, or an empty array to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The mentors relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "teachers" + ], + "summary": "Removes existing students from the mentors relationship of an individual teacher.", + "operationId": "deleteTeacherMentorsRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to remove students from.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the students to remove from the mentors relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The students were successfully removed, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, + "/teachers/{id}/teaches": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related courses of an individual teacher's teaches relationship.", + "operationId": "getTeacherTeaches", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related courses to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found courses, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/courseCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related courses of an individual teacher's teaches relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacherTeaches", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related courses to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The teacher does not exist." + } + } + } + }, + "/teachers/{id}/relationships/teaches": { + "get": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related course identities of an individual teacher's teaches relationship.", + "operationId": "getTeacherTeachesRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related course identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully returns the found course identities, or an empty array if none were found.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + }, + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/courseIdentifierCollectionResponseDocument" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "head": { + "tags": [ + "teachers" + ], + "summary": "Retrieves the related course identities of an individual teacher's teaches relationship without returning them.", + "description": "Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.", + "operationId": "headTeacherTeachesRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose related course identities to retrieve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", + "in": "query", + "description": "For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": "" + } + }, + { + "name": "If-None-Match", + "in": "header", + "description": "A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + }, + "Content-Length": { + "description": "Size of the HTTP response body, in bytes.", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + } + }, + "304": { + "description": "The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", + "headers": { + "ETag": { + "description": "A fingerprint of the HTTP response, which can be used in an If-None-Match header to only fetch changes.", + "required": true, + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "The query string is invalid." + }, + "404": { + "description": "The teacher does not exist." + } + } + }, + "post": { + "tags": [ + "teachers" + ], + "summary": "Adds existing courses to the teaches relationship of an individual teacher.", + "operationId": "postTeacherTeachesRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to add courses to.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the courses to add to the teaches relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The courses were successfully added, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "patch": { + "tags": [ + "teachers" + ], + "summary": "Assigns existing courses to the teaches relationship of an individual teacher.", + "operationId": "patchTeacherTeachesRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher whose teaches relationship to assign.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the courses to assign to the teaches relationship, or an empty array to clear the relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The teaches relationship was successfully updated, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + }, + "delete": { + "tags": [ + "teachers" + ], + "summary": "Removes existing courses from the teaches relationship of an individual teacher.", + "operationId": "deleteTeacherTeachesRelationship", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the teacher to remove courses from.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "The identities of the courses to remove from the teaches relationship.", + "content": { + "application/vnd.api+json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "The courses were successfully removed, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "The teacher or a related resource does not exist.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "addOperationCode": { + "enum": [ + "add" + ], + "type": "string" + }, + "addToCourseEnrollmentsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToCourseTaughtByRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseTaughtByRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToStudentEnrollmentsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToTeacherMentorsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "addToTeacherTeachesRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherTeachesRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "atomicOperation": { + "required": [ + "operationDiscriminator" + ], + "type": "object", + "properties": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "operationDiscriminator", + "mapping": { + "addCourse": "#/components/schemas/createCourseOperation", + "addEnrollment": "#/components/schemas/createEnrollmentOperation", + "addStudent": "#/components/schemas/createStudentOperation", + "addTeacher": "#/components/schemas/createTeacherOperation", + "addToCourseEnrollments": "#/components/schemas/addToCourseEnrollmentsRelationshipOperation", + "addToCourseTaughtBy": "#/components/schemas/addToCourseTaughtByRelationshipOperation", + "addToStudentEnrollments": "#/components/schemas/addToStudentEnrollmentsRelationshipOperation", + "addToTeacherMentors": "#/components/schemas/addToTeacherMentorsRelationshipOperation", + "addToTeacherTeaches": "#/components/schemas/addToTeacherTeachesRelationshipOperation", + "removeCourse": "#/components/schemas/deleteCourseOperation", + "removeEnrollment": "#/components/schemas/deleteEnrollmentOperation", + "removeFromStudentEnrollments": "#/components/schemas/removeFromStudentEnrollmentsRelationshipOperation", + "removeFromTeacherMentors": "#/components/schemas/removeFromTeacherMentorsRelationshipOperation", + "removeFromTeacherTeaches": "#/components/schemas/removeFromTeacherTeachesRelationshipOperation", + "removeTeacher": "#/components/schemas/deleteTeacherOperation", + "updateCourse": "#/components/schemas/updateCourseOperation", + "updateCourseEnrollments": "#/components/schemas/updateCourseEnrollmentsRelationshipOperation", + "updateEnrollment": "#/components/schemas/updateEnrollmentOperation", + "updateEnrollmentCourse": "#/components/schemas/updateEnrollmentCourseRelationshipOperation", + "updateEnrollmentStudent": "#/components/schemas/updateEnrollmentStudentRelationshipOperation", + "updateStudent": "#/components/schemas/updateStudentOperation", + "updateStudentEnrollments": "#/components/schemas/updateStudentEnrollmentsRelationshipOperation", + "updateStudentMentor": "#/components/schemas/updateStudentMentorRelationshipOperation", + "updateTeacher": "#/components/schemas/updateTeacherOperation", + "updateTeacherMentors": "#/components/schemas/updateTeacherMentorsRelationshipOperation", + "updateTeacherTeaches": "#/components/schemas/updateTeacherTeachesRelationshipOperation" + } + }, + "x-abstract": true + }, + "atomicResult": { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "attributesInCreateCourseRequest": { + "required": [ + "subject" + ], + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInCreateEnrollmentRequest": { + "type": "object", + "properties": { + "enrolledAt": { + "type": "string", + "format": "date" + }, + "graduatedAt": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInCreateStudentRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInCreateTeacherRequest": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateCourseRequest": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateEnrollmentRequest": { + "type": "object", + "properties": { + "enrolledAt": { + "type": "string", + "format": "date" + }, + "graduatedAt": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateStudentRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "attributesInUpdateTeacherRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "courseAttributesInResponse": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "courseCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "courseDataInResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/courseAttributesInResponse" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/courseRelationshipsInResponse" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceLinks" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "courseEnrollmentsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "courseEnrollmentsRelationshipName": { + "enum": [ + "enrollments" + ], + "type": "string", + "additionalProperties": false + }, + "courseIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "courseIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "courseIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "courseIdentifierResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "coursePrimaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "courseRelationshipsInResponse": { + "type": "object", + "properties": { + "taughtBy": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInResponse" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInResponse" + } + ] + } + }, + "additionalProperties": false + }, + "courseResourceType": { + "enum": [ + "courses" + ], + "type": "string", + "additionalProperties": false + }, + "courseSecondaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "courseTaughtByRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/courseTaughtByRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "courseTaughtByRelationshipName": { + "enum": [ + "taughtBy" + ], + "type": "string", + "additionalProperties": false + }, + "createCourseOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createCourseRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateCourseRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createEnrollmentOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createEnrollmentRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createStudentOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createStudentRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateStudentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "createTeacherOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "createTeacherRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateCourseRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateCourseRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateCourseRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateEnrollmentRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateEnrollmentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateStudentRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateStudentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateStudentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInCreateTeacherRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateTeacherRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInResponse": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "type", + "mapping": { + "courses": "#/components/schemas/courseDataInResponse", + "enrollments": "#/components/schemas/enrollmentDataInResponse", + "students": "#/components/schemas/studentDataInResponse", + "teachers": "#/components/schemas/teacherDataInResponse" + } + }, + "x-abstract": true + }, + "dataInUpdateCourseRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateCourseRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateCourseRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateEnrollmentRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateEnrollmentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateStudentRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateStudentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateStudentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "dataInUpdateTeacherRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateTeacherRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + }, + "deleteCourseOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "deleteEnrollmentOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "deleteTeacherOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "enrollmentAttributesInResponse": { + "type": "object", + "properties": { + "enrolledAt": { + "type": "string", + "format": "date" + }, + "graduatedAt": { + "type": "string", + "format": "date", + "nullable": true + }, + "hasGraduated": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false + }, + "enrollmentCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentCourseRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentCourseRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentCourseRelationshipName": { + "enum": [ + "course" + ], + "type": "string", + "additionalProperties": false + }, + "enrollmentDataInResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentAttributesInResponse" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentRelationshipsInResponse" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceLinks" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "enrollmentIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "enrollmentIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "enrollmentPrimaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentRelationshipsInResponse": { + "type": "object", + "properties": { + "student": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInResponse" + } + ] + }, + "course": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInResponse" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentResourceType": { + "enum": [ + "enrollments" + ], + "type": "string", + "additionalProperties": false + }, + "enrollmentStudentRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentStudentRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "enrollmentStudentRelationshipName": { + "enum": [ + "student" + ], + "type": "string", + "additionalProperties": false + }, + "errorLinks": { + "type": "object", + "properties": { + "about": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorObject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorLinks" + } + ], + "nullable": true + }, + "status": { + "type": "string" + }, + "code": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "source": { + "allOf": [ + { + "$ref": "#/components/schemas/errorSource" + } + ], + "nullable": true + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "errorResponseDocument": { + "required": [ + "errors", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/errorTopLevelLinks" + } + ] + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/errorObject" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "errorSource": { + "type": "object", + "properties": { + "pointer": { + "type": "string", + "nullable": true + }, + "parameter": { + "type": "string", + "nullable": true + }, + "header": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "errorTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, + "jsonapi": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "ext": { + "type": "array", + "items": { + "type": "string" + } + }, + "profile": { + "type": "array", + "items": { + "type": "string" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "meta": { + "type": "object", + "additionalProperties": { + "nullable": true + } + }, + "nullableTeacherIdentifierResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInResponse" + } + ], + "nullable": true + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "nullableTeacherSecondaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherDataInResponse" + } + ], + "nullable": true + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "nullableToOneTeacherInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + }, + "nullableToOneTeacherInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInResponse" + } + ], + "nullable": true + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "operationsRequestDocument": { + "required": [ + "atomic:operations" + ], + "type": "object", + "properties": { + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicOperation" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "operationsResponseDocument": { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicResult" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "related": { + "type": "string" + } + }, + "additionalProperties": false + }, + "relationshipsInCreateCourseRequest": { + "type": "object", + "properties": { + "taughtBy": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreateEnrollmentRequest": { + "required": [ + "course", + "student" + ], + "type": "object", + "properties": { + "student": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInRequest" + } + ] + }, + "course": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreateStudentRequest": { + "type": "object", + "properties": { + "mentor": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInCreateTeacherRequest": { + "type": "object", + "properties": { + "teaches": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + }, + "mentors": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateCourseRequest": { + "type": "object", + "properties": { + "taughtBy": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateEnrollmentRequest": { + "type": "object", + "properties": { + "student": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInRequest" + } + ] + }, + "course": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateStudentRequest": { + "type": "object", + "properties": { + "mentor": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipsInUpdateTeacherRequest": { + "type": "object", + "properties": { + "teaches": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + }, + "mentors": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "removeFromStudentEnrollmentsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeFromTeacherMentorsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeFromTeacherTeachesRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherTeachesRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeOperationCode": { + "enum": [ + "remove" + ], + "type": "string" + }, + "resourceCollectionTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + }, + "first": { + "type": "string" + }, + "last": { + "type": "string" + }, + "prev": { + "type": "string" + }, + "next": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceIdentifierCollectionTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "related": { + "type": "string" + }, + "describedby": { + "type": "string" + }, + "first": { + "type": "string" + }, + "last": { + "type": "string" + }, + "prev": { + "type": "string" + }, + "next": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceIdentifierTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "related": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + } + }, + "additionalProperties": false + }, + "resourceTopLevelLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "describedby": { + "type": "string" + } + }, + "additionalProperties": false + }, + "studentAttributesInResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "studentCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "studentDataInResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/studentAttributesInResponse" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/studentRelationshipsInResponse" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceLinks" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "studentEnrollmentsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "studentEnrollmentsRelationshipName": { + "enum": [ + "enrollments" + ], + "type": "string", + "additionalProperties": false + }, + "studentIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "studentIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "studentIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "studentIdentifierResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "studentMentorRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/studentMentorRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "studentMentorRelationshipName": { + "enum": [ + "mentor" + ], + "type": "string", + "additionalProperties": false + }, + "studentPrimaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "studentRelationshipsInResponse": { + "type": "object", + "properties": { + "mentor": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInResponse" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInResponse" + } + ] + } + }, + "additionalProperties": false + }, + "studentResourceType": { + "enum": [ + "students" + ], + "type": "string", + "additionalProperties": false + }, + "studentSecondaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "teacherAttributesInResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "teacherCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/teacherDataInResponse" + } + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "teacherDataInResponse": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + }, + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherAttributesInResponse" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherRelationshipsInResponse" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceLinks" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "teacherIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/teacherIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "teacherIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "teacherIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "teacherMentorsRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "teacherMentorsRelationshipName": { + "enum": [ + "mentors" + ], + "type": "string", + "additionalProperties": false + }, + "teacherPrimaryResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherDataInResponse" + } + ] + }, + "included": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "teacherRelationshipsInResponse": { + "type": "object", + "properties": { + "teaches": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInResponse" + } + ] + }, + "mentors": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInResponse" + } + ] + } + }, + "additionalProperties": false + }, + "teacherResourceType": { + "enum": [ + "teachers" + ], + "type": "string", + "additionalProperties": false + }, + "teacherTeachesRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherTeachesRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "teacherTeachesRelationshipName": { + "enum": [ + "teaches" + ], + "type": "string", + "additionalProperties": false + }, + "toManyCourseInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + } + }, + "additionalProperties": false + }, + "toManyCourseInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "toManyEnrollmentInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + }, + "toManyEnrollmentInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "toManyStudentInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + }, + "toManyStudentInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "toManyTeacherInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + } + }, + "additionalProperties": false + }, + "toManyTeacherInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/teacherIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "toOneCourseInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "toOneCourseInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "toOneStudentInRequest": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + }, + "toOneStudentInResponse": { + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipLinks" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "updateCourseEnrollmentsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateCourseOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateCourseRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateCourseRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateEnrollmentCourseRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentCourseRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateEnrollmentOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateEnrollmentRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateEnrollmentStudentRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentStudentRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateOperationCode": { + "enum": [ + "update" + ], + "type": "string" + }, + "updateStudentEnrollmentsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateStudentMentorRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentMentorRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateStudentOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateStudentRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateStudentRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateTeacherMentorsRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateTeacherOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateTeacherRequestDocument": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + }, + "updateTeacherTeachesRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherTeachesRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + } + } +} \ No newline at end of file diff --git a/test/OpenApiTests/AtomicOperations/OperationsController.cs b/test/OpenApiTests/AtomicOperations/OperationsController.cs new file mode 100644 index 0000000000..77b215a555 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/OperationsController.cs @@ -0,0 +1,13 @@ +using JsonApiDotNetCore.AtomicOperations; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Middleware; +using JsonApiDotNetCore.Resources; +using Microsoft.Extensions.Logging; + +namespace OpenApiTests.AtomicOperations; + +public sealed class OperationsController( + IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IOperationsProcessor processor, IJsonApiRequest request, + ITargetedFields targetedFields, IAtomicOperationFilter operationFilter) : JsonApiOperationsController(options, resourceGraph, loggerFactory, processor, + request, targetedFields, operationFilter); diff --git a/test/OpenApiTests/AtomicOperations/OperationsDbContext.cs b/test/OpenApiTests/AtomicOperations/OperationsDbContext.cs new file mode 100644 index 0000000000..8a1f7a8cf8 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/OperationsDbContext.cs @@ -0,0 +1,16 @@ +using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore; +using TestBuildingBlocks; + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +public sealed class OperationsDbContext(ISystemClock systemClock, DbContextOptions options) : TestableDbContext(options) +{ + internal ISystemClock SystemClock { get; } = systemClock; + + public DbSet Courses => Set(); + public DbSet Teachers => Set(); + public DbSet Students => Set(); + public DbSet Enrollments => Set(); +} diff --git a/test/OpenApiTests/AtomicOperations/OperationsFakers.cs b/test/OpenApiTests/AtomicOperations/OperationsFakers.cs new file mode 100644 index 0000000000..c77e045faa --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/OperationsFakers.cs @@ -0,0 +1,50 @@ +using Bogus; +using JetBrains.Annotations; +using Microsoft.Extensions.DependencyInjection; +using TestBuildingBlocks; + +// @formatter:wrap_chained_method_calls chop_if_long +// @formatter:wrap_before_first_method_call true + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +public sealed class OperationsFakers +{ + private readonly Lazy> _lazyCourseFaker = new(() => new Faker() + .MakeDeterministic() + .RuleFor(course => course.Subject, faker => faker.Lorem.Word()) + .RuleFor(course => course.Description, faker => faker.Lorem.Sentence())); + + private readonly Lazy> _lazyTeacherFaker = new(() => new Faker() + .MakeDeterministic() + .RuleFor(teacher => teacher.Name, faker => faker.Person.FullName) + .RuleFor(teacher => teacher.EmailAddress, faker => faker.Person.Email)); + + private readonly Lazy> _lazyStudentFaker = new(() => new Faker() + .MakeDeterministic() + .RuleFor(student => student.Name, faker => faker.Person.FullName) + .RuleFor(student => student.EmailAddress, faker => faker.Person.Email)); + + private readonly Lazy> _lazyEnrollmentFaker; + + public Faker Course => _lazyCourseFaker.Value; + public Faker Teacher => _lazyTeacherFaker.Value; + public Faker Student => _lazyStudentFaker.Value; + public Faker Enrollment => _lazyEnrollmentFaker.Value; + + public OperationsFakers(IServiceProvider serviceProvider) + { + _lazyEnrollmentFaker = new Lazy>(() => new Faker() + .MakeDeterministic() + .CustomInstantiator(_ => new Enrollment(ResolveDbContext(serviceProvider))) + .RuleFor(enrollment => enrollment.EnrolledAt, faker => faker.Date.PastDateOnly()) + .RuleFor(enrollment => enrollment.GraduatedAt, faker => faker.Date.RecentDateOnly())); + } + + private OperationsDbContext ResolveDbContext(IServiceProvider serviceProvider) + { + using IServiceScope scope = serviceProvider.CreateScope(); + return scope.ServiceProvider.GetRequiredService(); + } +} diff --git a/test/OpenApiTests/AtomicOperations/OperationsTests.cs b/test/OpenApiTests/AtomicOperations/OperationsTests.cs new file mode 100644 index 0000000000..a7c0619afc --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/OperationsTests.cs @@ -0,0 +1,2177 @@ +using System.Text.Json; +using JsonApiDotNetCore.Configuration; +using Microsoft.Extensions.DependencyInjection; +using TestBuildingBlocks; +using Xunit; + +namespace OpenApiTests.AtomicOperations; + +public sealed class OperationsTests : IClassFixture, OperationsDbContext>> +{ + private readonly OpenApiTestContext, OperationsDbContext> _testContext; + + public OperationsTests(OpenApiTestContext, OperationsDbContext> testContext) + { + _testContext = testContext; + + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + + testContext.ConfigureServices(services => services.AddSingleton()); + + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); + options.IncludeJsonApiVersion = true; + + testContext.SwaggerDocumentOutputDirectory = $"{GetType().Namespace!.Replace('.', '/')}/GeneratedSwagger"; + } + + [Fact] + public async Task Operations_endpoint_is_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("paths./operations.post").Should().BeJson(""" + { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "postOperations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/operationsRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/operationsResponseDocument" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + """); + } + + [Fact] + public async Task Operations_request_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + schemasElement.Should().ContainPath("operationsRequestDocument").Should().BeJson(""" + { + "required": [ + "atomic:operations" + ], + "type": "object", + "properties": { + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicOperation" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("atomicOperation").Should().BeJson(""" + { + "required": [ + "operationDiscriminator" + ], + "type": "object", + "properties": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "operationDiscriminator", + "mapping": { + "addCourse": "#/components/schemas/createCourseOperation", + "addEnrollment": "#/components/schemas/createEnrollmentOperation", + "addStudent": "#/components/schemas/createStudentOperation", + "addTeacher": "#/components/schemas/createTeacherOperation", + "addToCourseEnrollments": "#/components/schemas/addToCourseEnrollmentsRelationshipOperation", + "addToCourseTaughtBy": "#/components/schemas/addToCourseTaughtByRelationshipOperation", + "addToStudentEnrollments": "#/components/schemas/addToStudentEnrollmentsRelationshipOperation", + "addToTeacherMentors": "#/components/schemas/addToTeacherMentorsRelationshipOperation", + "addToTeacherTeaches": "#/components/schemas/addToTeacherTeachesRelationshipOperation", + "removeCourse": "#/components/schemas/deleteCourseOperation", + "removeEnrollment": "#/components/schemas/deleteEnrollmentOperation", + "removeFromStudentEnrollments": "#/components/schemas/removeFromStudentEnrollmentsRelationshipOperation", + "removeFromTeacherMentors": "#/components/schemas/removeFromTeacherMentorsRelationshipOperation", + "removeFromTeacherTeaches": "#/components/schemas/removeFromTeacherTeachesRelationshipOperation", + "removeTeacher": "#/components/schemas/deleteTeacherOperation", + "updateCourse": "#/components/schemas/updateCourseOperation", + "updateCourseEnrollments": "#/components/schemas/updateCourseEnrollmentsRelationshipOperation", + "updateEnrollment": "#/components/schemas/updateEnrollmentOperation", + "updateEnrollmentCourse": "#/components/schemas/updateEnrollmentCourseRelationshipOperation", + "updateEnrollmentStudent": "#/components/schemas/updateEnrollmentStudentRelationshipOperation", + "updateStudent": "#/components/schemas/updateStudentOperation", + "updateStudentEnrollments": "#/components/schemas/updateStudentEnrollmentsRelationshipOperation", + "updateStudentMentor": "#/components/schemas/updateStudentMentorRelationshipOperation", + "updateTeacher": "#/components/schemas/updateTeacherOperation", + "updateTeacherMentors": "#/components/schemas/updateTeacherMentorsRelationshipOperation", + "updateTeacherTeaches": "#/components/schemas/updateTeacherTeachesRelationshipOperation" + } + }, + "x-abstract": true + } + """); + + schemasElement.Should().ContainPath("addOperationCode").Should().BeJson(""" + { + "enum": [ + "add" + ], + "type": "string" + } + """); + + schemasElement.Should().ContainPath("updateOperationCode").Should().BeJson(""" + { + "enum": [ + "update" + ], + "type": "string" + } + """); + + schemasElement.Should().ContainPath("removeOperationCode").Should().BeJson(""" + { + "enum": [ + "remove" + ], + "type": "string" + } + """); + }); + } + + [Fact] + public async Task Operations_response_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + schemasElement.Should().ContainPath("operationsResponseDocument").Should().BeJson(""" + { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicResult" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("atomicResult").Should().BeJson(""" + { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + } + """); + }); + } + + [Fact] + public async Task Course_operation_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + // resource operations + schemasElement.Should().ContainPath("createCourseOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInCreateCourseRequest").Should().BeJson(""" + { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateCourseRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInCreateCourseRequest").Should().BeJson(""" + { + "required": [ + "subject" + ], + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInCreateCourseRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "taughtBy": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("updateCourseOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInUpdateCourseRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateCourseRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateCourseRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInUpdateCourseRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInUpdateCourseRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "taughtBy": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("deleteCourseOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // relationship operations + schemasElement.Should().ContainPath("updateCourseEnrollmentsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("addToCourseEnrollmentsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().NotContainPath("removeFromCourseEnrollmentsRelationshipOperation"); + + schemasElement.Should().NotContainPath("updateCourseTaughtByRelationshipOperation"); + + // shared types + schemasElement.Should().ContainPath("courseIdentifierInRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("courseEnrollmentsRelationshipIdentifier").Should().BeJson(""" + { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/courseResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/courseEnrollmentsRelationshipName" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("courseEnrollmentsRelationshipName").Should().BeJson(""" + { + "enum": [ + "enrollments" + ], + "type": "string", + "additionalProperties": false + } + """); + }); + } + + [Fact] + public async Task Student_operation_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + // resource operations + schemasElement.Should().ContainPath("createStudentOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInCreateStudentRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateStudentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInCreateStudentRequest").Should().BeJson(""" + { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInCreateStudentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "mentor": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("updateStudentOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInUpdateStudentRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateStudentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateStudentRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInUpdateStudentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInUpdateStudentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "mentor": { + "allOf": [ + { + "$ref": "#/components/schemas/nullableToOneTeacherInRequest" + } + ] + }, + "enrollments": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyEnrollmentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().NotContainPath("deleteStudentOperation"); + + // relationship operations + schemasElement.Should().ContainPath("updateStudentMentorRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentMentorRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("updateStudentEnrollmentsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("addToStudentEnrollmentsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("removeFromStudentEnrollmentsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // shared types + schemasElement.Should().ContainPath("studentIdentifierInRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("studentMentorRelationshipIdentifier").Should().BeJson(""" + { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/studentMentorRelationshipName" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("studentMentorRelationshipName").Should().BeJson(""" + { + "enum": [ + "mentor" + ], + "type": "string", + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("studentEnrollmentsRelationshipIdentifier").Should().BeJson(""" + { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/studentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/studentEnrollmentsRelationshipName" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("studentEnrollmentsRelationshipName").Should().BeJson(""" + { + "enum": [ + "enrollments" + ], + "type": "string", + "additionalProperties": false + } + """); + }); + } + + [Fact] + public async Task Teacher_operation_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + // resource operations + schemasElement.Should().ContainPath("createTeacherOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInCreateTeacherRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateTeacherRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInCreateTeacherRequest").Should().BeJson(""" + { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInCreateTeacherRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "teaches": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + }, + "mentors": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("updateTeacherOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInUpdateTeacherRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateTeacherRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateTeacherRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInUpdateTeacherRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "emailAddress": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInUpdateTeacherRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "teaches": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyCourseInRequest" + } + ] + }, + "mentors": { + "allOf": [ + { + "$ref": "#/components/schemas/toManyStudentInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("deleteTeacherOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // relationship operations + schemasElement.Should().ContainPath("updateTeacherMentorsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("addToTeacherMentorsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("removeFromTeacherMentorsRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/studentIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // shared types + schemasElement.Should().ContainPath("teacherIdentifierInRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("teacherMentorsRelationshipIdentifier").Should().BeJson(""" + { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/teacherMentorsRelationshipName" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("teacherMentorsRelationshipName").Should().BeJson(""" + { + "enum": [ + "mentors" + ], + "type": "string", + "additionalProperties": false + } + """); + }); + } + + [Fact] + public async Task Enrollment_operation_component_schemas_are_exposed() + { + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + // resource operations + schemasElement.Should().ContainPath("createEnrollmentOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInCreateEnrollmentRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInCreateEnrollmentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInCreateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInCreateEnrollmentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "enrolledAt": { + "type": "string", + "format": "date" + }, + "graduatedAt": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInCreateEnrollmentRequest").Should().BeJson(""" + { + "required": [ + "course", + "student" + ], + "type": "object", + "properties": { + "student": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInRequest" + } + ] + }, + "course": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("updateEnrollmentOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("dataInUpdateEnrollmentRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "attributes": { + "allOf": [ + { + "$ref": "#/components/schemas/attributesInUpdateEnrollmentRequest" + } + ] + }, + "relationships": { + "allOf": [ + { + "$ref": "#/components/schemas/relationshipsInUpdateEnrollmentRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("attributesInUpdateEnrollmentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "enrolledAt": { + "type": "string", + "format": "date" + }, + "graduatedAt": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("relationshipsInUpdateEnrollmentRequest").Should().BeJson(""" + { + "type": "object", + "properties": { + "student": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneStudentInRequest" + } + ] + }, + "course": { + "allOf": [ + { + "$ref": "#/components/schemas/toOneCourseInRequest" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("deleteEnrollmentOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // relationship operations + schemasElement.Should().ContainPath("updateEnrollmentCourseRelationshipOperation").Should().BeJson(""" + { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentCourseRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/courseIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + } + """); + + // shared types + schemasElement.Should().ContainPath("enrollmentIdentifierInRequest").Should().BeJson(""" + { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("enrollmentCourseRelationshipIdentifier").Should().BeJson(""" + { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/enrollmentCourseRelationshipName" + } + ] + } + }, + "additionalProperties": false + } + """); + + schemasElement.Should().ContainPath("enrollmentCourseRelationshipName").Should().BeJson(""" + { + "enum": [ + "course" + ], + "type": "string", + "additionalProperties": false + } + """); + }); + } +} diff --git a/test/OpenApiTests/AtomicOperations/Student.cs b/test/OpenApiTests/AtomicOperations/Student.cs new file mode 100644 index 0000000000..465fa52bc0 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/Student.cs @@ -0,0 +1,23 @@ +using JetBrains.Annotations; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Resources; +using JsonApiDotNetCore.Resources.Annotations; + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +[Resource(ControllerNamespace = "OpenApiTests.AtomicOperations", GenerateControllerEndpoints = JsonApiEndpoints.All & ~JsonApiEndpoints.Delete)] +public sealed class Student : Identifiable +{ + [Attr] + public string Name { get; set; } = null!; + + [Attr] + public string? EmailAddress { get; set; } + + [HasOne] + public Teacher? Mentor { get; set; } + + [HasMany] + public ISet Enrollments { get; set; } = new HashSet(); +} diff --git a/test/OpenApiTests/AtomicOperations/Teacher.cs b/test/OpenApiTests/AtomicOperations/Teacher.cs new file mode 100644 index 0000000000..86ff5bb4d4 --- /dev/null +++ b/test/OpenApiTests/AtomicOperations/Teacher.cs @@ -0,0 +1,22 @@ +using JetBrains.Annotations; +using JsonApiDotNetCore.Resources; +using JsonApiDotNetCore.Resources.Annotations; + +namespace OpenApiTests.AtomicOperations; + +[UsedImplicitly(ImplicitUseTargetFlags.Members)] +[Resource(ControllerNamespace = "OpenApiTests.AtomicOperations")] +public sealed class Teacher : Identifiable +{ + [Attr] + public string Name { get; set; } = null!; + + [Attr] + public string? EmailAddress { get; set; } + + [HasMany] + public ISet Teaches { get; set; } = new HashSet(); + + [HasMany] + public ISet Mentors { get; set; } = new HashSet(); +} diff --git a/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs b/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs index 34140cb882..72d719ba3b 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs +++ b/test/OpenApiTests/ClientIdGenerationModes/ClientIdGenerationTests.cs @@ -31,6 +31,7 @@ public async Task Schema_property_for_ID_is_required_in_post_request() dataElement.Should().ContainPath("required").With(requiredElement => { requiredElement.Should().ContainArrayElement("id"); + requiredElement.Should().NotContainArrayElement("lid"); }); dataElement.Should().ContainPath("properties.id"); @@ -49,6 +50,7 @@ public async Task Schema_property_for_ID_is_optional_in_post_request() dataElement.Should().ContainPath("required").With(requiredElement => { requiredElement.Should().NotContainArrayElement("id"); + requiredElement.Should().NotContainArrayElement("lid"); }); dataElement.Should().ContainPath("properties.id"); @@ -67,6 +69,7 @@ public async Task Schema_property_for_ID_is_omitted_in_post_request() dataElement.Should().ContainPath("required").With(requiredElement => { requiredElement.Should().NotContainArrayElement("id"); + requiredElement.Should().NotContainArrayElement("lid"); }); dataElement.Should().NotContainPath("properties.id"); diff --git a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json index d80da35899..bc8dd1b44d 100644 --- a/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json @@ -517,7 +517,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -525,10 +524,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -683,8 +678,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -712,7 +714,28 @@ ], "additionalProperties": false }, - "gameIdentifier": { + "gameIdentifierInRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/gameResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "gameIdentifierInResponse": { "required": [ "id", "type" @@ -798,8 +821,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -849,8 +879,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -885,7 +922,28 @@ ], "additionalProperties": false }, - "playerGroupIdentifier": { + "playerGroupIdentifierInRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/playerGroupResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "playerGroupIdentifierInResponse": { "required": [ "id", "type" @@ -963,7 +1021,28 @@ "type": "string", "additionalProperties": false }, - "playerIdentifier": { + "playerIdentifierInRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/playerResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "playerIdentifierInResponse": { "required": [ "id", "type" @@ -1123,7 +1202,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/gameIdentifier" + "$ref": "#/components/schemas/gameIdentifierInRequest" } } }, @@ -1142,7 +1221,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/gameIdentifier" + "$ref": "#/components/schemas/gameIdentifierInResponse" } }, "meta": { @@ -1164,7 +1243,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/playerGroupIdentifier" + "$ref": "#/components/schemas/playerGroupIdentifierInRequest" } } }, @@ -1183,7 +1262,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/playerGroupIdentifier" + "$ref": "#/components/schemas/playerGroupIdentifierInResponse" } }, "meta": { @@ -1205,7 +1284,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/playerIdentifier" + "$ref": "#/components/schemas/playerIdentifierInRequest" } } }, @@ -1224,7 +1303,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/playerIdentifier" + "$ref": "#/components/schemas/playerIdentifierInResponse" } }, "meta": { diff --git a/test/OpenApiTests/Documentation/DocumentationTests.cs b/test/OpenApiTests/Documentation/DocumentationTests.cs index aea6da87ed..2f35416245 100644 --- a/test/OpenApiTests/Documentation/DocumentationTests.cs +++ b/test/OpenApiTests/Documentation/DocumentationTests.cs @@ -23,6 +23,7 @@ public DocumentationTests(OpenApiTestContext(); testContext.UseController(); testContext.UseController(); + testContext.UseController(); } [Fact] @@ -124,6 +125,8 @@ public async Task Endpoints_are_documented() parametersElement.Should().HaveProperty("[0].description", ResourceTextQueryString); }); + postElement.Should().HaveProperty("requestBody.description", "The attributes and relationships of the skyscraper to create."); + postElement.Should().ContainPath("responses").With(responsesElement => { responsesElement.EnumerateObject().ShouldHaveCount(6); @@ -580,6 +583,28 @@ public async Task Endpoints_are_documented() }); }); }); + + document.Should().ContainPath("paths./operations").With(skyscrapersElement => + { + skyscrapersElement.Should().ContainPath("post").With(postElement => + { + postElement.Should().HaveProperty("summary", "Performs multiple mutations in a linear and atomic manner."); + + postElement.Should().HaveProperty("requestBody.description", "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/)."); + + postElement.Should().ContainPath("responses").With(responsesElement => + { + responsesElement.EnumerateObject().ShouldHaveCount(7); + responsesElement.Should().HaveProperty("200.description", "All operations were successfully applied, which resulted in additional changes."); + responsesElement.Should().HaveProperty("204.description", "All operations were successfully applied, which did not result in additional changes."); + responsesElement.Should().HaveProperty("400.description", "The request body is missing or malformed."); + responsesElement.Should().HaveProperty("403.description", "An operation is not accessible or a client-generated ID is used."); + responsesElement.Should().HaveProperty("404.description", "A resource or a related resource does not exist."); + responsesElement.Should().HaveProperty("409.description", "The request body contains conflicting information or another resource with the same ID already exists."); + responsesElement.Should().HaveProperty("422.description", "Validation of the request body failed."); + }); + }); + }); } [Fact] diff --git a/test/OpenApiTests/Documentation/ErrorResponseTests.cs b/test/OpenApiTests/Documentation/ErrorResponseTests.cs index 673e3ee19d..e7b6765fac 100644 --- a/test/OpenApiTests/Documentation/ErrorResponseTests.cs +++ b/test/OpenApiTests/Documentation/ErrorResponseTests.cs @@ -8,6 +8,7 @@ namespace OpenApiTests.Documentation; public sealed class ErrorResponseTests : IClassFixture, DocumentationDbContext>> { private const string EscapedJsonApiMediaType = "['application/vnd.api+json']"; + private const string EscapedOperationsMediaType = "['application/vnd.api+json; ext=atomic-operations']"; private readonly OpenApiTestContext, DocumentationDbContext> _testContext; @@ -18,6 +19,7 @@ public ErrorResponseTests(OpenApiTestContext(); testContext.UseController(); testContext.UseController(); + testContext.UseController(); } [Fact] @@ -271,6 +273,25 @@ public async Task Applicable_error_status_codes_with_schema_are_provided_on_endp property.Value.Should().ContainPath($"content.{EscapedJsonApiMediaType}.schema.$ref").ShouldBeSchemaReferenceId("errorResponseDocument")); }); }); + + document.Should().ContainPath("paths./operations").With(skyscrapersElement => + { + skyscrapersElement.Should().ContainPath("post.responses").With(responsesElement => + { + JsonProperty[] errorStatusCodeProperties = responsesElement.EnumerateObject().Where(IsErrorStatusCode).ToArray(); + errorStatusCodeProperties.ShouldHaveCount(5); + + errorStatusCodeProperties[0].Name.Should().Be("400"); + errorStatusCodeProperties[1].Name.Should().Be("403"); + errorStatusCodeProperties[2].Name.Should().Be("404"); + errorStatusCodeProperties[3].Name.Should().Be("409"); + errorStatusCodeProperties[4].Name.Should().Be("422"); + + errorStatusCodeProperties.Should().AllSatisfy(property => + property.Value.Should().ContainPath($"content.{EscapedOperationsMediaType}.schema.$ref") + .ShouldBeSchemaReferenceId("errorResponseDocument")); + }); + }); } [Fact] diff --git a/test/OpenApiTests/Documentation/OperationsController.cs b/test/OpenApiTests/Documentation/OperationsController.cs new file mode 100644 index 0000000000..e5becdb05b --- /dev/null +++ b/test/OpenApiTests/Documentation/OperationsController.cs @@ -0,0 +1,13 @@ +using JsonApiDotNetCore.AtomicOperations; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Middleware; +using JsonApiDotNetCore.Resources; +using Microsoft.Extensions.Logging; + +namespace OpenApiTests.Documentation; + +public sealed class OperationsController( + IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IOperationsProcessor processor, IJsonApiRequest request, + ITargetedFields targetedFields, IAtomicOperationFilter operationFilter) : JsonApiOperationsController(options, resourceGraph, loggerFactory, processor, + request, targetedFields, operationFilter); diff --git a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json index 6dca80592f..e5baa14a8e 100644 --- a/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json @@ -1212,8 +1212,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -1353,7 +1360,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -1361,10 +1367,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -1588,8 +1590,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -1617,7 +1626,37 @@ ], "additionalProperties": false }, - "languageIdentifier": { + "languageIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/languageIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "languageIdentifierInRequest": { "required": [ "id", "type" @@ -1638,32 +1677,23 @@ }, "additionalProperties": false }, - "languageIdentifierCollectionResponseDocument": { + "languageIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/languageResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/languageIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -1800,7 +1830,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/languageIdentifier" + "$ref": "#/components/schemas/languageIdentifierInRequest" } } }, @@ -1819,7 +1849,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/languageIdentifier" + "$ref": "#/components/schemas/languageIdentifierInResponse" } }, "meta": { diff --git a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json index bd688df03f..fd45cd28a2 100644 --- a/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/LegacyOpenApi/GeneratedSwagger/swagger.g.json @@ -5969,8 +5969,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -6397,7 +6404,6 @@ }, "data-in-response": { "required": [ - "id", "type" ], "type": "object", @@ -6405,10 +6411,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -6759,8 +6761,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -6795,27 +6804,6 @@ ], "additionalProperties": false }, - "flight-attendant-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "flight-attendant-identifier-collection-response-document": { "required": [ "data", @@ -6840,7 +6828,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } }, "meta": { @@ -6853,6 +6841,48 @@ }, "additionalProperties": false }, + "flight-attendant-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "flight-attendant-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "flight-attendant-identifier-response-document": { "required": [ "data", @@ -6877,7 +6907,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ] }, @@ -7093,8 +7123,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -7129,27 +7166,6 @@ ], "additionalProperties": false }, - "flight-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "flight-identifier-collection-response-document": { "required": [ "data", @@ -7174,7 +7190,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-response" } }, "meta": { @@ -7187,6 +7203,48 @@ }, "additionalProperties": false }, + "flight-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "flight-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "flight-primary-response-document": { "required": [ "data", @@ -7330,7 +7388,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ], "nullable": true @@ -7399,7 +7457,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } ], "nullable": true @@ -7420,7 +7478,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ], "nullable": true @@ -7501,8 +7559,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -7530,27 +7595,6 @@ ], "additionalProperties": false }, - "passenger-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "passenger-identifier-collection-response-document": { "required": [ "data", @@ -7575,7 +7619,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-response" } }, "meta": { @@ -7588,6 +7632,48 @@ }, "additionalProperties": false }, + "passenger-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "passenger-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "passenger-primary-response-document": { "required": [ "data", @@ -7884,7 +7970,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } } }, @@ -7903,7 +7989,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } }, "meta": { @@ -7925,7 +8011,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-request" } } }, @@ -7944,7 +8030,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-response" } }, "meta": { @@ -7966,7 +8052,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-request" } } }, @@ -7985,7 +8071,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-response" } }, "meta": { @@ -8007,7 +8093,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } ] } @@ -8027,7 +8113,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ] }, diff --git a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json index bd688df03f..fd45cd28a2 100644 --- a/test/OpenApiTests/LegacyOpenApi/expected-swagger.json +++ b/test/OpenApiTests/LegacyOpenApi/expected-swagger.json @@ -5969,8 +5969,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -6397,7 +6404,6 @@ }, "data-in-response": { "required": [ - "id", "type" ], "type": "object", @@ -6405,10 +6411,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -6759,8 +6761,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -6795,27 +6804,6 @@ ], "additionalProperties": false }, - "flight-attendant-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-attendant-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "flight-attendant-identifier-collection-response-document": { "required": [ "data", @@ -6840,7 +6828,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } }, "meta": { @@ -6853,6 +6841,48 @@ }, "additionalProperties": false }, + "flight-attendant-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "flight-attendant-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-attendant-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "flight-attendant-identifier-response-document": { "required": [ "data", @@ -6877,7 +6907,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ] }, @@ -7093,8 +7123,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -7129,27 +7166,6 @@ ], "additionalProperties": false }, - "flight-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/flight-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "flight-identifier-collection-response-document": { "required": [ "data", @@ -7174,7 +7190,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-response" } }, "meta": { @@ -7187,6 +7203,48 @@ }, "additionalProperties": false }, + "flight-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "flight-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/flight-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "flight-primary-response-document": { "required": [ "data", @@ -7330,7 +7388,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ], "nullable": true @@ -7399,7 +7457,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } ], "nullable": true @@ -7420,7 +7478,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ], "nullable": true @@ -7501,8 +7559,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -7530,27 +7595,6 @@ ], "additionalProperties": false }, - "passenger-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/passenger-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "passenger-identifier-collection-response-document": { "required": [ "data", @@ -7575,7 +7619,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-response" } }, "meta": { @@ -7588,6 +7632,48 @@ }, "additionalProperties": false }, + "passenger-identifier-in-request": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "passenger-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/passenger-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "passenger-primary-response-document": { "required": [ "data", @@ -7884,7 +7970,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } } }, @@ -7903,7 +7989,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } }, "meta": { @@ -7925,7 +8011,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-request" } } }, @@ -7944,7 +8030,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/flight-identifier" + "$ref": "#/components/schemas/flight-identifier-in-response" } }, "meta": { @@ -7966,7 +8052,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-request" } } }, @@ -7985,7 +8071,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/passenger-identifier" + "$ref": "#/components/schemas/passenger-identifier-in-response" } }, "meta": { @@ -8007,7 +8093,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-request" } ] } @@ -8027,7 +8113,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/flight-attendant-identifier" + "$ref": "#/components/schemas/flight-attendant-identifier-in-response" } ] }, diff --git a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json index 2cc51547c4..bdb469c35e 100644 --- a/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/Links/Enabled/GeneratedSwagger/swagger.g.json @@ -3700,8 +3700,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3729,7 +3736,28 @@ ], "additionalProperties": false }, - "accommodationIdentifier": { + "accommodationIdentifierInRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/accommodationResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "accommodationIdentifierInResponse": { "required": [ "id", "type" @@ -3767,7 +3795,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/accommodationIdentifier" + "$ref": "#/components/schemas/accommodationIdentifierInResponse" } ] }, @@ -4148,7 +4176,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -4156,10 +4183,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -4470,8 +4493,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4499,7 +4529,37 @@ ], "additionalProperties": false }, - "excursionIdentifier": { + "excursionIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/excursionIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "excursionIdentifierInRequest": { "required": [ "id", "type" @@ -4520,32 +4580,23 @@ }, "additionalProperties": false }, - "excursionIdentifierCollectionResponseDocument": { + "excursionIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/excursionResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/excursionIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -4609,7 +4660,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/transportIdentifier" + "$ref": "#/components/schemas/transportIdentifierInRequest" } ], "nullable": true @@ -4630,7 +4681,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/transportIdentifier" + "$ref": "#/components/schemas/transportIdentifierInResponse" } ], "nullable": true @@ -4662,7 +4713,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/transportIdentifier" + "$ref": "#/components/schemas/transportIdentifierInResponse" } ], "nullable": true @@ -4880,7 +4931,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/excursionIdentifier" + "$ref": "#/components/schemas/excursionIdentifierInRequest" } } }, @@ -4899,7 +4950,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/excursionIdentifier" + "$ref": "#/components/schemas/excursionIdentifierInResponse" } }, "meta": { @@ -4921,7 +4972,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/accommodationIdentifier" + "$ref": "#/components/schemas/accommodationIdentifierInRequest" } ] } @@ -4941,7 +4992,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/accommodationIdentifier" + "$ref": "#/components/schemas/accommodationIdentifierInResponse" } ] }, @@ -5014,8 +5065,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5043,7 +5101,28 @@ ], "additionalProperties": false }, - "transportIdentifier": { + "transportIdentifierInRequest": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/transportResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "transportIdentifierInResponse": { "required": [ "id", "type" @@ -5238,8 +5317,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json index a75539036b..76bb828376 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net6.0/swagger.g.json @@ -466,7 +466,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -474,10 +473,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -768,8 +763,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { diff --git a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json index 4590d6c75d..d5f7e25326 100644 --- a/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json +++ b/test/OpenApiTests/ModelStateValidation/GeneratedSwagger/net8.0/swagger.g.json @@ -484,7 +484,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -492,10 +491,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -795,8 +790,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { diff --git a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs index d2b882cd2c..7b95b8a312 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs @@ -14,6 +14,7 @@ public CamelCaseTests(OpenApiTestContext(); testContext.UseController(); + testContext.UseController(); testContext.SwaggerDocumentOutputDirectory = $"{GetType().Namespace!.Replace('.', '/')}/GeneratedSwagger"; } @@ -125,7 +126,7 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; relatedResourceIdentifierSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("staffMemberIdentifier").SchemaReferenceId; + .ShouldBeSchemaReferenceId("staffMemberIdentifierInResponse").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relationshipLinksSchemaRefId}.properties").With(propertiesElement => @@ -551,6 +552,120 @@ public async Task Casing_convention_is_applied_to_DeleteRelationship_endpoint() }); } + [Fact] + public async Task Casing_convention_is_applied_to_PostOperations_endpoint() + { + // Act + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + // Assert + document.Should().ContainPath("paths./operations.post").With(getElement => + { + getElement.Should().ContainPath("operationId").With(operationElement => + { + operationElement.Should().Be("postOperations"); + }); + + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + .ShouldBeSchemaReferenceId("operationsRequestDocument"); + + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + .ShouldBeSchemaReferenceId("operationsResponseDocument"); + }); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + schemasElement.Should().ContainPath("addOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("add")); + schemasElement.Should().ContainPath("updateOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("update")); + schemasElement.Should().ContainPath("removeOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("remove")); + + schemasElement.Should().ContainPath("atomicOperation.discriminator.mapping").With(mappingElement => + { + mappingElement.Should().ContainPath("addStaffMember").ShouldBeSchemaReferenceId("createStaffMemberOperation"); + mappingElement.Should().ContainPath("addSupermarket").ShouldBeSchemaReferenceId("createSupermarketOperation"); + mappingElement.Should().ContainPath("addToSupermarketCashiers").ShouldBeSchemaReferenceId("addToSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("removeFromSupermarketCashiers") + .ShouldBeSchemaReferenceId("removeFromSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("removeStaffMember").ShouldBeSchemaReferenceId("deleteStaffMemberOperation"); + mappingElement.Should().ContainPath("removeSupermarket").ShouldBeSchemaReferenceId("deleteSupermarketOperation"); + mappingElement.Should().ContainPath("updateStaffMember").ShouldBeSchemaReferenceId("updateStaffMemberOperation"); + mappingElement.Should().ContainPath("updateSupermarket").ShouldBeSchemaReferenceId("updateSupermarketOperation"); + + mappingElement.Should().ContainPath("updateSupermarketBackupStoreManager") + .ShouldBeSchemaReferenceId("updateSupermarketBackupStoreManagerRelationshipOperation"); + + mappingElement.Should().ContainPath("updateSupermarketCashiers").ShouldBeSchemaReferenceId("updateSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("updateSupermarketStoreManager") + .ShouldBeSchemaReferenceId("updateSupermarketStoreManagerRelationshipOperation"); + }); + + schemasElement.Should().ContainPath("createSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("dataInCreateSupermarketRequest"); + }); + + schemasElement.Should().ContainPath("updateSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketIdentifierInRequest"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("dataInUpdateSupermarketRequest"); + }); + + schemasElement.Should().ContainPath("deleteSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("updateSupermarketStoreManagerRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketStoreManagerRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("updateSupermarketBackupStoreManagerRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketBackupStoreManagerRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("updateSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("addToSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("removeFromSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("createStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("dataInCreateStaffMemberRequest"); + }); + + schemasElement.Should().ContainPath("updateStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("dataInUpdateStaffMemberRequest"); + }); + + schemasElement.Should().ContainPath("deleteStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("staffMemberIdentifierInRequest"); + }); + }); + } + [Fact] public async Task Casing_convention_is_applied_to_error_schema() { diff --git a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json index daf63bf136..33e147d814 100644 --- a/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/CamelCase/GeneratedSwagger/swagger.g.json @@ -10,6 +10,95 @@ } ], "paths": { + "/operations": { + "post": { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "postOperations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/operationsRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/operationsResponseDocument" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/errorResponseDocument" + } + } + } + } + } + } + }, "/staffMembers": { "get": { "tags": [ @@ -2523,6 +2612,104 @@ }, "components": { "schemas": { + "addOperationCode": { + "enum": [ + "add" + ], + "type": "string" + }, + "addToSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "atomicOperation": { + "required": [ + "operationDiscriminator" + ], + "type": "object", + "properties": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "operationDiscriminator", + "mapping": { + "addStaffMember": "#/components/schemas/createStaffMemberOperation", + "addSupermarket": "#/components/schemas/createSupermarketOperation", + "addToSupermarketCashiers": "#/components/schemas/addToSupermarketCashiersRelationshipOperation", + "removeFromSupermarketCashiers": "#/components/schemas/removeFromSupermarketCashiersRelationshipOperation", + "removeStaffMember": "#/components/schemas/deleteStaffMemberOperation", + "removeSupermarket": "#/components/schemas/deleteSupermarketOperation", + "updateStaffMember": "#/components/schemas/updateStaffMemberOperation", + "updateSupermarket": "#/components/schemas/updateSupermarketOperation", + "updateSupermarketBackupStoreManager": "#/components/schemas/updateSupermarketBackupStoreManagerRelationshipOperation", + "updateSupermarketCashiers": "#/components/schemas/updateSupermarketCashiersRelationshipOperation", + "updateSupermarketStoreManager": "#/components/schemas/updateSupermarketStoreManagerRelationshipOperation" + } + }, + "x-abstract": true + }, + "atomicResult": { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, "attributesInCreateStaffMemberRequest": { "required": [ "name" @@ -2587,6 +2774,38 @@ }, "additionalProperties": false }, + "createStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "createStaffMemberRequestDocument": { "required": [ "data" @@ -2603,6 +2822,38 @@ }, "additionalProperties": false }, + "createSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/addOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "createSupermarketRequestDocument": { "required": [ "data" @@ -2632,6 +2883,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2655,6 +2910,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2674,7 +2933,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -2682,10 +2940,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -2700,7 +2954,6 @@ }, "dataInUpdateStaffMemberRequest": { "required": [ - "id", "type" ], "type": "object", @@ -2716,6 +2969,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2728,7 +2985,6 @@ }, "dataInUpdateSupermarketRequest": { "required": [ - "id", "type" ], "type": "object", @@ -2744,6 +3000,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2761,6 +3021,70 @@ }, "additionalProperties": false }, + "deleteStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "deleteSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "errorLinks": { "type": "object", "properties": { @@ -2948,7 +3272,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } ], "nullable": true @@ -3017,7 +3341,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" } ], "nullable": true @@ -3038,7 +3362,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } ], "nullable": true @@ -3053,11 +3377,72 @@ }, "additionalProperties": false }, - "relationshipLinks": { + "operationsRequestDocument": { + "required": [ + "atomic:operations" + ], "type": "object", "properties": { - "self": { - "type": "string" + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicOperation" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "operationsResponseDocument": { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceTopLevelLinks" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomicResult" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "relationshipLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" }, "related": { "type": "string" @@ -3122,6 +3507,51 @@ }, "additionalProperties": false }, + "removeFromSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/removeOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "removeOperationCode": { + "enum": [ + "remove" + ], + "type": "string" + }, "resourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -3271,8 +3701,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3300,27 +3737,6 @@ ], "additionalProperties": false }, - "staffMemberIdentifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/staffMemberResourceType" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "staffMemberIdentifierCollectionResponseDocument": { "required": [ "data", @@ -3345,7 +3761,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } }, "meta": { @@ -3358,6 +3774,51 @@ }, "additionalProperties": false }, + "staffMemberIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "staffMemberIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "staffMemberIdentifierResponseDocument": { "required": [ "data", @@ -3382,7 +3843,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } ] }, @@ -3507,6 +3968,84 @@ }, "additionalProperties": false }, + "supermarketBackupStoreManagerRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketBackupStoreManagerRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "supermarketBackupStoreManagerRelationshipName": { + "enum": [ + "backupStoreManager" + ], + "type": "string", + "additionalProperties": false + }, + "supermarketCashiersRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketCashiersRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "supermarketCashiersRelationshipName": { + "enum": [ + "cashiers" + ], + "type": "string", + "additionalProperties": false + }, "supermarketCollectionResponseDocument": { "required": [ "data", @@ -3556,8 +4095,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3592,6 +4138,30 @@ ], "additionalProperties": false }, + "supermarketIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "supermarketPrimaryResponseDocument": { "required": [ "data", @@ -3670,6 +4240,45 @@ "type": "string", "additionalProperties": false }, + "supermarketStoreManagerRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketStoreManagerRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "supermarketStoreManagerRelationshipName": { + "enum": [ + "storeManager" + ], + "type": "string", + "additionalProperties": false + }, "supermarketType": { "enum": [ "Traditional", @@ -3687,7 +4296,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" } } }, @@ -3706,7 +4315,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } }, "meta": { @@ -3728,7 +4337,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" } ] } @@ -3748,7 +4357,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staffMemberIdentifier" + "$ref": "#/components/schemas/staffMemberIdentifierInResponse" } ] }, @@ -3762,6 +4371,51 @@ }, "additionalProperties": false }, + "updateOperationCode": { + "enum": [ + "update" + ], + "type": "string" + }, + "updateStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "updateStaffMemberRequestDocument": { "required": [ "data" @@ -3778,6 +4432,125 @@ }, "additionalProperties": false }, + "updateSupermarketBackupStoreManagerRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketBackupStoreManagerRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "updateSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/dataInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "updateSupermarketRequestDocument": { "required": [ "data" @@ -3793,6 +4566,46 @@ } }, "additionalProperties": false + }, + "updateSupermarketStoreManagerRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/updateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarketStoreManagerRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/staffMemberIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json index c98b0c40b4..a03541fb39 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/KebabCase/GeneratedSwagger/swagger.g.json @@ -10,6 +10,95 @@ } ], "paths": { + "/operations": { + "post": { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "post-operations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/operations-request-document" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/operations-response-document" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/error-response-document" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/error-response-document" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/error-response-document" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/error-response-document" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/error-response-document" + } + } + } + } + } + } + }, "/staff-members": { "get": { "tags": [ @@ -2523,6 +2612,104 @@ }, "components": { "schemas": { + "add-operation-code": { + "enum": [ + "add" + ], + "type": "string" + }, + "add-to-supermarket-cashiers-relationship-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/add-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-cashiers-relationship-identifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "atomic-operation": { + "required": [ + "operation-discriminator" + ], + "type": "object", + "properties": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "operation-discriminator", + "mapping": { + "add-staff-member": "#/components/schemas/create-staff-member-operation", + "add-supermarket": "#/components/schemas/create-supermarket-operation", + "add-to-supermarket-cashiers": "#/components/schemas/add-to-supermarket-cashiers-relationship-operation", + "remove-from-supermarket-cashiers": "#/components/schemas/remove-from-supermarket-cashiers-relationship-operation", + "remove-staff-member": "#/components/schemas/delete-staff-member-operation", + "remove-supermarket": "#/components/schemas/delete-supermarket-operation", + "update-staff-member": "#/components/schemas/update-staff-member-operation", + "update-supermarket": "#/components/schemas/update-supermarket-operation", + "update-supermarket-backup-store-manager": "#/components/schemas/update-supermarket-backup-store-manager-relationship-operation", + "update-supermarket-cashiers": "#/components/schemas/update-supermarket-cashiers-relationship-operation", + "update-supermarket-store-manager": "#/components/schemas/update-supermarket-store-manager-relationship-operation" + } + }, + "x-abstract": true + }, + "atomic-result": { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-response" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, "attributes-in-create-staff-member-request": { "required": [ "name" @@ -2587,6 +2774,38 @@ }, "additionalProperties": false }, + "create-staff-member-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/add-operation-code" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-staff-member-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "create-staff-member-request-document": { "required": [ "data" @@ -2603,6 +2822,38 @@ }, "additionalProperties": false }, + "create-supermarket-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/add-operation-code" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-create-supermarket-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "create-supermarket-request-document": { "required": [ "data" @@ -2632,6 +2883,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2655,6 +2910,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2674,7 +2933,6 @@ }, "data-in-response": { "required": [ - "id", "type" ], "type": "object", @@ -2682,10 +2940,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -2700,7 +2954,6 @@ }, "data-in-update-staff-member-request": { "required": [ - "id", "type" ], "type": "object", @@ -2716,6 +2969,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2728,7 +2985,6 @@ }, "data-in-update-supermarket-request": { "required": [ - "id", "type" ], "type": "object", @@ -2744,6 +3000,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2761,6 +3021,70 @@ }, "additionalProperties": false }, + "delete-staff-member-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/remove-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "delete-supermarket-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/remove-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-identifier-in-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "error-links": { "type": "object", "properties": { @@ -2948,7 +3272,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } ], "nullable": true @@ -3017,7 +3341,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-request" } ], "nullable": true @@ -3038,7 +3362,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } ], "nullable": true @@ -3053,11 +3377,72 @@ }, "additionalProperties": false }, - "relationship-links": { + "operations-request-document": { + "required": [ + "atomic:operations" + ], "type": "object", "properties": { - "self": { - "type": "string" + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomic-operation" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "operations-response-document": { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resource-top-level-links" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/atomic-result" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "relationship-links": { + "type": "object", + "properties": { + "self": { + "type": "string" }, "related": { "type": "string" @@ -3122,6 +3507,51 @@ }, "additionalProperties": false }, + "remove-from-supermarket-cashiers-relationship-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/remove-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-cashiers-relationship-identifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "remove-operation-code": { + "enum": [ + "remove" + ], + "type": "string" + }, "resource-collection-top-level-links": { "type": "object", "properties": { @@ -3271,8 +3701,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3300,27 +3737,6 @@ ], "additionalProperties": false }, - "staff-member-identifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/staff-member-resource-type" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "staff-member-identifier-collection-response-document": { "required": [ "data", @@ -3345,7 +3761,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } }, "meta": { @@ -3358,6 +3774,51 @@ }, "additionalProperties": false }, + "staff-member-identifier-in-request": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "staff-member-identifier-in-response": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "staff-member-identifier-response-document": { "required": [ "data", @@ -3382,7 +3843,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } ] }, @@ -3507,6 +3968,84 @@ }, "additionalProperties": false }, + "supermarket-backup-store-manager-relationship-identifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-backup-store-manager-relationship-name" + } + ] + } + }, + "additionalProperties": false + }, + "supermarket-backup-store-manager-relationship-name": { + "enum": [ + "backup-store-manager" + ], + "type": "string", + "additionalProperties": false + }, + "supermarket-cashiers-relationship-identifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-cashiers-relationship-name" + } + ] + } + }, + "additionalProperties": false + }, + "supermarket-cashiers-relationship-name": { + "enum": [ + "cashiers" + ], + "type": "string", + "additionalProperties": false + }, "supermarket-collection-response-document": { "required": [ "data", @@ -3556,8 +4095,15 @@ "$ref": "#/components/schemas/data-in-response" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3592,6 +4138,30 @@ ], "additionalProperties": false }, + "supermarket-identifier-in-request": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "supermarket-primary-response-document": { "required": [ "data", @@ -3670,6 +4240,45 @@ "type": "string", "additionalProperties": false }, + "supermarket-store-manager-relationship-identifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-resource-type" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-store-manager-relationship-name" + } + ] + } + }, + "additionalProperties": false + }, + "supermarket-store-manager-relationship-name": { + "enum": [ + "store-manager" + ], + "type": "string", + "additionalProperties": false + }, "supermarket-type": { "enum": [ "Traditional", @@ -3687,7 +4296,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-request" } } }, @@ -3706,7 +4315,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } }, "meta": { @@ -3728,7 +4337,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-request" } ] } @@ -3748,7 +4357,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/staff-member-identifier" + "$ref": "#/components/schemas/staff-member-identifier-in-response" } ] }, @@ -3762,6 +4371,51 @@ }, "additionalProperties": false }, + "update-operation-code": { + "enum": [ + "update" + ], + "type": "string" + }, + "update-staff-member-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/update-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-staff-member-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "update-staff-member-request-document": { "required": [ "data" @@ -3778,6 +4432,125 @@ }, "additionalProperties": false }, + "update-supermarket-backup-store-manager-relationship-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/update-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-backup-store-manager-relationship-identifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "update-supermarket-cashiers-relationship-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/update-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-cashiers-relationship-identifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "update-supermarket-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/update-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-identifier-in-request" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/data-in-update-supermarket-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "update-supermarket-request-document": { "required": [ "data" @@ -3793,6 +4566,46 @@ } }, "additionalProperties": false + }, + "update-supermarket-store-manager-relationship-operation": { + "allOf": [ + { + "$ref": "#/components/schemas/atomic-operation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/update-operation-code" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/supermarket-store-manager-relationship-identifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/staff-member-identifier-in-request" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs index f3b3b8f7a0..6200c0c7fe 100644 --- a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs @@ -14,6 +14,7 @@ public KebabCaseTests(OpenApiTestContext(); testContext.UseController(); + testContext.UseController(); testContext.SwaggerDocumentOutputDirectory = $"{GetType().Namespace!.Replace('.', '/')}/GeneratedSwagger"; } @@ -125,7 +126,7 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; relatedResourceIdentifierSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("staff-member-identifier").SchemaReferenceId; + .ShouldBeSchemaReferenceId("staff-member-identifier-in-response").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relationshipLinksSchemaRefId}.properties").With(propertiesElement => @@ -553,6 +554,125 @@ public async Task Casing_convention_is_applied_to_DeleteRelationship_endpoint() }); } + [Fact] + public async Task Casing_convention_is_applied_to_PostOperations_endpoint() + { + // Act + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + // Assert + document.Should().ContainPath("paths./operations.post").With(getElement => + { + getElement.Should().ContainPath("operationId").With(operationElement => + { + operationElement.Should().Be("post-operations"); + }); + + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + .ShouldBeSchemaReferenceId("operations-request-document"); + + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + .ShouldBeSchemaReferenceId("operations-response-document"); + }); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + schemasElement.Should().ContainPath("add-operation-code.enum").With(codeElement => codeElement.Should().ContainArrayElement("add")); + schemasElement.Should().ContainPath("update-operation-code.enum").With(codeElement => codeElement.Should().ContainArrayElement("update")); + schemasElement.Should().ContainPath("remove-operation-code.enum").With(codeElement => codeElement.Should().ContainArrayElement("remove")); + + schemasElement.Should().ContainPath("atomic-operation.discriminator.mapping").With(mappingElement => + { + mappingElement.Should().ContainPath("add-staff-member").ShouldBeSchemaReferenceId("create-staff-member-operation"); + mappingElement.Should().ContainPath("add-supermarket").ShouldBeSchemaReferenceId("create-supermarket-operation"); + + mappingElement.Should().ContainPath("add-to-supermarket-cashiers") + .ShouldBeSchemaReferenceId("add-to-supermarket-cashiers-relationship-operation"); + + mappingElement.Should().ContainPath("remove-from-supermarket-cashiers") + .ShouldBeSchemaReferenceId("remove-from-supermarket-cashiers-relationship-operation"); + + mappingElement.Should().ContainPath("remove-staff-member").ShouldBeSchemaReferenceId("delete-staff-member-operation"); + mappingElement.Should().ContainPath("remove-supermarket").ShouldBeSchemaReferenceId("delete-supermarket-operation"); + mappingElement.Should().ContainPath("update-staff-member").ShouldBeSchemaReferenceId("update-staff-member-operation"); + mappingElement.Should().ContainPath("update-supermarket").ShouldBeSchemaReferenceId("update-supermarket-operation"); + + mappingElement.Should().ContainPath("update-supermarket-backup-store-manager") + .ShouldBeSchemaReferenceId("update-supermarket-backup-store-manager-relationship-operation"); + + mappingElement.Should().ContainPath("update-supermarket-cashiers") + .ShouldBeSchemaReferenceId("update-supermarket-cashiers-relationship-operation"); + + mappingElement.Should().ContainPath("update-supermarket-store-manager") + .ShouldBeSchemaReferenceId("update-supermarket-store-manager-relationship-operation"); + }); + + schemasElement.Should().ContainPath("create-supermarket-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("data-in-create-supermarket-request"); + }); + + schemasElement.Should().ContainPath("update-supermarket-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-identifier-in-request"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("data-in-update-supermarket-request"); + }); + + schemasElement.Should().ContainPath("delete-supermarket-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("update-supermarket-store-manager-relationship-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-store-manager-relationship-identifier"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("update-supermarket-backup-store-manager-relationship-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref") + .ShouldBeSchemaReferenceId("supermarket-backup-store-manager-relationship-identifier"); + + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("update-supermarket-cashiers-relationship-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-cashiers-relationship-identifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("add-to-supermarket-cashiers-relationship-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-cashiers-relationship-identifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("remove-from-supermarket-cashiers-relationship-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("supermarket-cashiers-relationship-identifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + + schemasElement.Should().ContainPath("create-staff-member-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("data-in-create-staff-member-request"); + }); + + schemasElement.Should().ContainPath("update-staff-member-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("data-in-update-staff-member-request"); + }); + + schemasElement.Should().ContainPath("delete-staff-member-operation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("staff-member-identifier-in-request"); + }); + }); + } + [Fact] public async Task Casing_convention_is_applied_to_error_schema() { diff --git a/test/OpenApiTests/NamingConventions/OperationsController.cs b/test/OpenApiTests/NamingConventions/OperationsController.cs new file mode 100644 index 0000000000..f42dc455b1 --- /dev/null +++ b/test/OpenApiTests/NamingConventions/OperationsController.cs @@ -0,0 +1,13 @@ +using JsonApiDotNetCore.AtomicOperations; +using JsonApiDotNetCore.Configuration; +using JsonApiDotNetCore.Controllers; +using JsonApiDotNetCore.Middleware; +using JsonApiDotNetCore.Resources; +using Microsoft.Extensions.Logging; + +namespace OpenApiTests.NamingConventions; + +public sealed class OperationsController( + IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IOperationsProcessor processor, IJsonApiRequest request, + ITargetedFields targetedFields, IAtomicOperationFilter operationFilter) : JsonApiOperationsController(options, resourceGraph, loggerFactory, processor, + request, targetedFields, operationFilter); diff --git a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json index 67d02bf10a..d92549bd78 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/NamingConventions/PascalCase/GeneratedSwagger/swagger.g.json @@ -10,6 +10,95 @@ } ], "paths": { + "/Operations": { + "post": { + "tags": [ + "operations" + ], + "summary": "Performs multiple mutations in a linear and atomic manner.", + "operationId": "PostOperations", + "requestBody": { + "description": "An array of mutation operations. For syntax, see the [Atomic Operations documentation](https://jsonapi.org/ext/atomic/).", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OperationsRequestDocument" + } + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "All operations were successfully applied, which resulted in additional changes.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/OperationsResponseDocument" + } + } + } + }, + "204": { + "description": "All operations were successfully applied, which did not result in additional changes." + }, + "400": { + "description": "The request body is missing or malformed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseDocument" + } + } + } + }, + "403": { + "description": "An operation is not accessible or a client-generated ID is used.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseDocument" + } + } + } + }, + "404": { + "description": "A resource or a related resource does not exist.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseDocument" + } + } + } + }, + "409": { + "description": "The request body contains conflicting information or another resource with the same ID already exists.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseDocument" + } + } + } + }, + "422": { + "description": "Validation of the request body failed.", + "content": { + "application/vnd.api+json; ext=atomic-operations": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseDocument" + } + } + } + } + } + } + }, "/StaffMembers": { "get": { "tags": [ @@ -2523,6 +2612,104 @@ }, "components": { "schemas": { + "AddOperationCode": { + "enum": [ + "add" + ], + "type": "string" + }, + "AddToSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/AddOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "AtomicOperation": { + "required": [ + "OperationDiscriminator" + ], + "type": "object", + "properties": { + "Meta": { + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] + } + }, + "additionalProperties": false, + "discriminator": { + "propertyName": "OperationDiscriminator", + "mapping": { + "AddStaffMember": "#/components/schemas/CreateStaffMemberOperation", + "AddSupermarket": "#/components/schemas/CreateSupermarketOperation", + "AddToSupermarketCashiers": "#/components/schemas/AddToSupermarketCashiersRelationshipOperation", + "RemoveFromSupermarketCashiers": "#/components/schemas/RemoveFromSupermarketCashiersRelationshipOperation", + "RemoveStaffMember": "#/components/schemas/DeleteStaffMemberOperation", + "RemoveSupermarket": "#/components/schemas/DeleteSupermarketOperation", + "UpdateStaffMember": "#/components/schemas/UpdateStaffMemberOperation", + "UpdateSupermarket": "#/components/schemas/UpdateSupermarketOperation", + "UpdateSupermarketBackupStoreManager": "#/components/schemas/UpdateSupermarketBackupStoreManagerRelationshipOperation", + "UpdateSupermarketCashiers": "#/components/schemas/UpdateSupermarketCashiersRelationshipOperation", + "UpdateSupermarketStoreManager": "#/components/schemas/UpdateSupermarketStoreManagerRelationshipOperation" + } + }, + "x-abstract": true + }, + "AtomicResult": { + "type": "object", + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInResponse" + } + ] + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] + } + }, + "additionalProperties": false + }, "AttributesInCreateStaffMemberRequest": { "required": [ "Name" @@ -2587,6 +2774,38 @@ }, "additionalProperties": false }, + "CreateStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/AddOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInCreateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "CreateStaffMemberRequestDocument": { "required": [ "data" @@ -2603,6 +2822,38 @@ }, "additionalProperties": false }, + "CreateSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/AddOperationCode" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInCreateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "CreateSupermarketRequestDocument": { "required": [ "data" @@ -2632,6 +2883,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2655,6 +2910,10 @@ } ] }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2674,7 +2933,6 @@ }, "DataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -2682,10 +2940,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -2700,7 +2954,6 @@ }, "DataInUpdateStaffMemberRequest": { "required": [ - "id", "type" ], "type": "object", @@ -2716,6 +2969,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2728,7 +2985,6 @@ }, "DataInUpdateSupermarketRequest": { "required": [ - "id", "type" ], "type": "object", @@ -2744,6 +3000,10 @@ "minLength": 1, "type": "string" }, + "lid": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -2761,6 +3021,70 @@ }, "additionalProperties": false }, + "DeleteStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "DeleteSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "ErrorLinks": { "type": "object", "properties": { @@ -2948,7 +3272,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } ], "nullable": true @@ -3017,7 +3341,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" } ], "nullable": true @@ -3038,7 +3362,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } ], "nullable": true @@ -3053,13 +3377,74 @@ }, "additionalProperties": false }, - "RelationshipLinks": { + "OperationsRequestDocument": { + "required": [ + "atomic:operations" + ], "type": "object", "properties": { - "self": { - "type": "string" + "atomic:operations": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/AtomicOperation" + } }, - "related": { + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] + } + }, + "additionalProperties": false + }, + "OperationsResponseDocument": { + "required": [ + "atomic:results", + "links" + ], + "type": "object", + "properties": { + "jsonapi": { + "allOf": [ + { + "$ref": "#/components/schemas/Jsonapi" + } + ] + }, + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/ResourceTopLevelLinks" + } + ] + }, + "atomic:results": { + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/components/schemas/AtomicResult" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/Meta" + } + ] + } + }, + "additionalProperties": false + }, + "RelationshipLinks": { + "type": "object", + "properties": { + "self": { + "type": "string" + }, + "related": { "type": "string" } }, @@ -3122,6 +3507,51 @@ }, "additionalProperties": false }, + "RemoveFromSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/RemoveOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "RemoveOperationCode": { + "enum": [ + "remove" + ], + "type": "string" + }, "ResourceCollectionTopLevelLinks": { "type": "object", "properties": { @@ -3271,8 +3701,15 @@ "$ref": "#/components/schemas/DataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3300,27 +3737,6 @@ ], "additionalProperties": false }, - "StaffMemberIdentifier": { - "required": [ - "id", - "type" - ], - "type": "object", - "properties": { - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/StaffMemberResourceType" - } - ] - }, - "id": { - "minLength": 1, - "type": "string" - } - }, - "additionalProperties": false - }, "StaffMemberIdentifierCollectionResponseDocument": { "required": [ "data", @@ -3345,7 +3761,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } }, "meta": { @@ -3358,6 +3774,51 @@ }, "additionalProperties": false }, + "StaffMemberIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, + "StaffMemberIdentifierInResponse": { + "required": [ + "id", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "StaffMemberIdentifierResponseDocument": { "required": [ "data", @@ -3382,7 +3843,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } ] }, @@ -3507,6 +3968,84 @@ }, "additionalProperties": false }, + "SupermarketBackupStoreManagerRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketBackupStoreManagerRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "SupermarketBackupStoreManagerRelationshipName": { + "enum": [ + "BackupStoreManager" + ], + "type": "string", + "additionalProperties": false + }, + "SupermarketCashiersRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketCashiersRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "SupermarketCashiersRelationshipName": { + "enum": [ + "Cashiers" + ], + "type": "string", + "additionalProperties": false + }, "SupermarketCollectionResponseDocument": { "required": [ "data", @@ -3556,8 +4095,15 @@ "$ref": "#/components/schemas/DataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3592,6 +4138,30 @@ ], "additionalProperties": false }, + "SupermarketIdentifierInRequest": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + } + }, + "additionalProperties": false + }, "SupermarketPrimaryResponseDocument": { "required": [ "data", @@ -3670,6 +4240,45 @@ "type": "string", "additionalProperties": false }, + "SupermarketStoreManagerRelationshipIdentifier": { + "required": [ + "relationship", + "type" + ], + "type": "object", + "properties": { + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketResourceType" + } + ] + }, + "id": { + "minLength": 1, + "type": "string" + }, + "lid": { + "minLength": 1, + "type": "string" + }, + "relationship": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketStoreManagerRelationshipName" + } + ] + } + }, + "additionalProperties": false + }, + "SupermarketStoreManagerRelationshipName": { + "enum": [ + "StoreManager" + ], + "type": "string", + "additionalProperties": false + }, "SupermarketType": { "enum": [ "Traditional", @@ -3687,7 +4296,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" } } }, @@ -3706,7 +4315,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } }, "meta": { @@ -3728,7 +4337,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" } ] } @@ -3748,7 +4357,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/StaffMemberIdentifier" + "$ref": "#/components/schemas/StaffMemberIdentifierInResponse" } ] }, @@ -3762,6 +4371,51 @@ }, "additionalProperties": false }, + "UpdateOperationCode": { + "enum": [ + "update" + ], + "type": "string" + }, + "UpdateStaffMemberOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInUpdateStaffMemberRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "UpdateStaffMemberRequestDocument": { "required": [ "data" @@ -3778,6 +4432,125 @@ }, "additionalProperties": false }, + "UpdateSupermarketBackupStoreManagerRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketBackupStoreManagerRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + ], + "nullable": true + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "UpdateSupermarketCashiersRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketCashiersRelationshipIdentifier" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, + "UpdateSupermarketOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketIdentifierInRequest" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/DataInUpdateSupermarketRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false + }, "UpdateSupermarketRequestDocument": { "required": [ "data" @@ -3793,6 +4566,46 @@ } }, "additionalProperties": false + }, + "UpdateSupermarketStoreManagerRelationshipOperation": { + "allOf": [ + { + "$ref": "#/components/schemas/AtomicOperation" + }, + { + "required": [ + "data", + "op", + "ref" + ], + "type": "object", + "properties": { + "op": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateOperationCode" + } + ] + }, + "ref": { + "allOf": [ + { + "$ref": "#/components/schemas/SupermarketStoreManagerRelationshipIdentifier" + } + ] + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/StaffMemberIdentifierInRequest" + } + ] + } + }, + "additionalProperties": false + } + ], + "additionalProperties": false } } } diff --git a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs index 91029eb271..43b821e992 100644 --- a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs +++ b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs @@ -14,6 +14,7 @@ public PascalCaseTests(OpenApiTestContext(); testContext.UseController(); + testContext.UseController(); testContext.SwaggerDocumentOutputDirectory = $"{GetType().Namespace!.Replace('.', '/')}/GeneratedSwagger"; } @@ -125,7 +126,7 @@ public async Task Casing_convention_is_applied_to_GetCollection_endpoint() .SchemaReferenceId; relatedResourceIdentifierSchemaRefId = propertiesElement.Should().ContainPath("data.allOf[0].$ref") - .ShouldBeSchemaReferenceId("StaffMemberIdentifier").SchemaReferenceId; + .ShouldBeSchemaReferenceId("StaffMemberIdentifierInResponse").SchemaReferenceId; }); schemasElement.Should().ContainPath($"{relationshipLinksSchemaRefId}.properties").With(propertiesElement => @@ -551,6 +552,120 @@ public async Task Casing_convention_is_applied_to_DeleteRelationship_endpoint() }); } + [Fact] + public async Task Casing_convention_is_applied_to_PostOperations_endpoint() + { + // Act + JsonElement document = await _testContext.GetSwaggerDocumentAsync(); + + // Assert + document.Should().ContainPath("paths./Operations.post").With(getElement => + { + getElement.Should().ContainPath("operationId").With(operationElement => + { + operationElement.Should().Be("PostOperations"); + }); + + getElement.Should().ContainPath("requestBody.content['application/vnd.api+json; ext=atomic-operations'].schema.allOf[0].$ref") + .ShouldBeSchemaReferenceId("OperationsRequestDocument"); + + getElement.Should().ContainPath("responses.200.content['application/vnd.api+json; ext=atomic-operations'].schema.$ref") + .ShouldBeSchemaReferenceId("OperationsResponseDocument"); + }); + + document.Should().ContainPath("components.schemas").With(schemasElement => + { + schemasElement.Should().ContainPath("AddOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("add")); + schemasElement.Should().ContainPath("UpdateOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("update")); + schemasElement.Should().ContainPath("RemoveOperationCode.enum").With(codeElement => codeElement.Should().ContainArrayElement("remove")); + + schemasElement.Should().ContainPath("AtomicOperation.discriminator.mapping").With(mappingElement => + { + mappingElement.Should().ContainPath("AddStaffMember").ShouldBeSchemaReferenceId("CreateStaffMemberOperation"); + mappingElement.Should().ContainPath("AddSupermarket").ShouldBeSchemaReferenceId("CreateSupermarketOperation"); + mappingElement.Should().ContainPath("AddToSupermarketCashiers").ShouldBeSchemaReferenceId("AddToSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("RemoveFromSupermarketCashiers") + .ShouldBeSchemaReferenceId("RemoveFromSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("RemoveStaffMember").ShouldBeSchemaReferenceId("DeleteStaffMemberOperation"); + mappingElement.Should().ContainPath("RemoveSupermarket").ShouldBeSchemaReferenceId("DeleteSupermarketOperation"); + mappingElement.Should().ContainPath("UpdateStaffMember").ShouldBeSchemaReferenceId("UpdateStaffMemberOperation"); + mappingElement.Should().ContainPath("UpdateSupermarket").ShouldBeSchemaReferenceId("UpdateSupermarketOperation"); + + mappingElement.Should().ContainPath("UpdateSupermarketBackupStoreManager") + .ShouldBeSchemaReferenceId("UpdateSupermarketBackupStoreManagerRelationshipOperation"); + + mappingElement.Should().ContainPath("UpdateSupermarketCashiers").ShouldBeSchemaReferenceId("UpdateSupermarketCashiersRelationshipOperation"); + + mappingElement.Should().ContainPath("UpdateSupermarketStoreManager") + .ShouldBeSchemaReferenceId("UpdateSupermarketStoreManagerRelationshipOperation"); + }); + + schemasElement.Should().ContainPath("CreateSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("DataInCreateSupermarketRequest"); + }); + + schemasElement.Should().ContainPath("UpdateSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketIdentifierInRequest"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("DataInUpdateSupermarketRequest"); + }); + + schemasElement.Should().ContainPath("DeleteSupermarketOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("UpdateSupermarketStoreManagerRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketStoreManagerRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("UpdateSupermarketBackupStoreManagerRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketBackupStoreManagerRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("UpdateSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("AddToSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("RemoveFromSupermarketCashiersRelationshipOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("SupermarketCashiersRelationshipIdentifier"); + propertiesElement.Should().ContainPath("data.items.$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + + schemasElement.Should().ContainPath("CreateStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("DataInCreateStaffMemberRequest"); + }); + + schemasElement.Should().ContainPath("UpdateStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + propertiesElement.Should().ContainPath("data.allOf[0].$ref").ShouldBeSchemaReferenceId("DataInUpdateStaffMemberRequest"); + }); + + schemasElement.Should().ContainPath("DeleteStaffMemberOperation.allOf[1].properties").With(propertiesElement => + { + propertiesElement.Should().ContainPath("ref.allOf[0].$ref").ShouldBeSchemaReferenceId("StaffMemberIdentifierInRequest"); + }); + }); + } + [Fact] public async Task Casing_convention_is_applied_to_error_schema() { diff --git a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json index fdd3b0cac8..58a5b4c20c 100644 --- a/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/QueryStrings/GeneratedSwagger/swagger.g.json @@ -3227,7 +3227,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -3235,10 +3234,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -3504,8 +3499,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3540,7 +3542,37 @@ ], "additionalProperties": false }, - "nameValuePairIdentifier": { + "nameValuePairIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/nameValuePairIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "nameValuePairIdentifierInRequest": { "required": [ "id", "type" @@ -3561,32 +3593,23 @@ }, "additionalProperties": false }, - "nameValuePairIdentifierCollectionResponseDocument": { + "nameValuePairIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/nameValuePairResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/nameValuePairIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -3703,8 +3726,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3739,7 +3769,37 @@ ], "additionalProperties": false }, - "nodeIdentifier": { + "nodeIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/nodeIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "nodeIdentifierInRequest": { "required": [ "id", "type" @@ -3760,32 +3820,23 @@ }, "additionalProperties": false }, - "nodeIdentifierCollectionResponseDocument": { + "nodeIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/nodeResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/nodeIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -3807,7 +3858,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInResponse" } ] }, @@ -3946,7 +3997,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInResponse" } ], "nullable": true @@ -4008,7 +4059,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInRequest" } ], "nullable": true @@ -4029,7 +4080,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInResponse" } ], "nullable": true @@ -4235,7 +4286,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/nameValuePairIdentifier" + "$ref": "#/components/schemas/nameValuePairIdentifierInRequest" } } }, @@ -4254,7 +4305,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/nameValuePairIdentifier" + "$ref": "#/components/schemas/nameValuePairIdentifierInResponse" } }, "meta": { @@ -4276,7 +4327,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInRequest" } } }, @@ -4295,7 +4346,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInResponse" } }, "meta": { @@ -4317,7 +4368,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInRequest" } ] } @@ -4337,7 +4388,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/nodeIdentifier" + "$ref": "#/components/schemas/nodeIdentifierInResponse" } ] }, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index 7f7aa014bb..e5e8f32caa 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -2631,7 +2631,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -2639,10 +2638,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -2732,8 +2727,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "links": { "allOf": [ { @@ -2754,7 +2756,37 @@ ], "additionalProperties": false }, - "emptyIdentifier": { + "emptyIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/emptyIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "emptyIdentifierInRequest": { "required": [ "id", "type" @@ -2775,32 +2807,23 @@ }, "additionalProperties": false }, - "emptyIdentifierCollectionResponseDocument": { + "emptyIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/emptyResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/emptyIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -2957,7 +2980,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3019,7 +3042,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ], "nullable": true @@ -3040,7 +3063,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3238,8 +3261,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3424,7 +3454,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } } }, @@ -3443,7 +3473,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } }, "meta": { diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index 332362db65..ecc17cd9dc 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -2626,7 +2626,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -2634,10 +2633,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -2727,8 +2722,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "links": { "allOf": [ { @@ -2749,7 +2751,37 @@ ], "additionalProperties": false }, - "emptyIdentifier": { + "emptyIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/emptyIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "emptyIdentifierInRequest": { "required": [ "id", "type" @@ -2770,32 +2802,23 @@ }, "additionalProperties": false }, - "emptyIdentifierCollectionResponseDocument": { + "emptyIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/emptyResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/emptyIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -2817,7 +2840,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, @@ -3020,7 +3043,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3082,7 +3105,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ], "nullable": true @@ -3103,7 +3126,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3298,8 +3321,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -3484,7 +3514,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } } }, @@ -3503,7 +3533,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } }, "meta": { @@ -3525,7 +3555,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ] } @@ -3545,7 +3575,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json index ad419cec82..cf6839cfba 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedSwagger/swagger.g.json @@ -3478,7 +3478,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -3486,10 +3485,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -3579,8 +3574,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "links": { "allOf": [ { @@ -3601,7 +3603,37 @@ ], "additionalProperties": false }, - "emptyIdentifier": { + "emptyIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/emptyIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "emptyIdentifierInRequest": { "required": [ "id", "type" @@ -3622,32 +3654,23 @@ }, "additionalProperties": false }, - "emptyIdentifierCollectionResponseDocument": { + "emptyIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/emptyResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/emptyIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -3669,7 +3692,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, @@ -3872,7 +3895,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3934,7 +3957,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ], "nullable": true @@ -3955,7 +3978,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -4189,8 +4212,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4389,7 +4419,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } } }, @@ -4408,7 +4438,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } }, "meta": { @@ -4430,7 +4460,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ] } @@ -4450,7 +4480,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json index a4326b97c9..b9b514594a 100644 --- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedSwagger/swagger.g.json @@ -3474,7 +3474,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -3482,10 +3481,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -3575,8 +3570,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "links": { "allOf": [ { @@ -3597,7 +3599,37 @@ ], "additionalProperties": false }, - "emptyIdentifier": { + "emptyIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/emptyIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "emptyIdentifierInRequest": { "required": [ "id", "type" @@ -3618,32 +3650,23 @@ }, "additionalProperties": false }, - "emptyIdentifierCollectionResponseDocument": { + "emptyIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/emptyResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/emptyIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -3665,7 +3688,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, @@ -3868,7 +3891,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -3930,7 +3953,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ], "nullable": true @@ -3951,7 +3974,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ], "nullable": true @@ -4183,8 +4206,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4383,7 +4413,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } } }, @@ -4402,7 +4432,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } }, "meta": { @@ -4424,7 +4454,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInRequest" } ] } @@ -4444,7 +4474,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/emptyIdentifier" + "$ref": "#/components/schemas/emptyIdentifierInResponse" } ] }, diff --git a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json index e385148aa7..fa9c935ca2 100644 --- a/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json +++ b/test/OpenApiTests/RestrictedControllers/GeneratedSwagger/swagger.g.json @@ -4072,7 +4072,6 @@ }, "dataInResponse": { "required": [ - "id", "type" ], "type": "object", @@ -4080,10 +4079,6 @@ "type": { "minLength": 1, "type": "string" - }, - "id": { - "minLength": 1, - "type": "string" } }, "additionalProperties": false, @@ -4185,8 +4180,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4214,7 +4216,37 @@ ], "additionalProperties": false }, - "dataStreamIdentifier": { + "dataStreamIdentifierCollectionResponseDocument": { + "required": [ + "data", + "links" + ], + "type": "object", + "properties": { + "links": { + "allOf": [ + { + "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + } + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" + } + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/meta" + } + ] + } + }, + "additionalProperties": false + }, + "dataStreamIdentifierInRequest": { "required": [ "id", "type" @@ -4235,32 +4267,23 @@ }, "additionalProperties": false }, - "dataStreamIdentifierCollectionResponseDocument": { + "dataStreamIdentifierInResponse": { "required": [ - "data", - "links" + "id", + "type" ], "type": "object", "properties": { - "links": { + "type": { "allOf": [ { - "$ref": "#/components/schemas/resourceIdentifierCollectionTopLevelLinks" + "$ref": "#/components/schemas/dataStreamResourceType" } ] }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/dataStreamIdentifier" - } - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/meta" - } - ] + "id": { + "minLength": 1, + "type": "string" } }, "additionalProperties": false @@ -4282,7 +4305,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" } ] }, @@ -4522,7 +4545,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" } ], "nullable": true @@ -4584,7 +4607,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInRequest" } ], "nullable": true @@ -4605,7 +4628,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" } ], "nullable": true @@ -4680,8 +4703,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -4840,8 +4870,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { @@ -5105,7 +5142,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInRequest" } } }, @@ -5124,7 +5161,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" } }, "meta": { @@ -5146,7 +5183,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInRequest" } ] } @@ -5166,7 +5203,7 @@ "data": { "allOf": [ { - "$ref": "#/components/schemas/dataStreamIdentifier" + "$ref": "#/components/schemas/dataStreamIdentifierInResponse" } ] }, @@ -5220,8 +5257,15 @@ "$ref": "#/components/schemas/dataInResponse" }, { + "required": [ + "id" + ], "type": "object", "properties": { + "id": { + "minLength": 1, + "type": "string" + }, "attributes": { "allOf": [ { diff --git a/test/TestBuildingBlocks/JsonElementAssertionExtensions.cs b/test/TestBuildingBlocks/JsonElementAssertionExtensions.cs index 412148c26a..f4df8938dd 100644 --- a/test/TestBuildingBlocks/JsonElementAssertionExtensions.cs +++ b/test/TestBuildingBlocks/JsonElementAssertionExtensions.cs @@ -147,5 +147,10 @@ public void NotContainArrayElement(string value) stringValues.Should().NotContain(value); } + + public void BeJson(string json) + { + _subject.ToString().Should().BeJson(json); + } } }